Beginners Question: I have created a new page for my site and want to add it to the Navbar menu but I can't find the URL? I have tried adding the UID to the main site URL but just get a 404 page? How do I find the URL of a page I have created?
Just asking for a quick bit of help here @Prismic-Support-Team thank you.
Hello @chimni
Thanks for reaching out to us.
You need to create a menu Custom Type and add the Link field to link with that new page. Here is a JSON configuration for that:
{
"Main" : {
"title" : {
"type" : "StructuredText",
"config" : {
"placeholder" : "Menu title...",
"single" : "heading1"
}
},
"menu_links" : {
"type" : "Group",
"config" : {
"fields" : {
"label" : {
"type" : "StructuredText",
"config" : {
"single" : "paragraph",
"label" : "Link Label",
"placeholder" : "Link Label..."
}
},
"link" : {
"type" : "Link",
"config" : {
"label" : "Link",
"placeholder" : "Select a Link..."
}
}
},
"label" : "Menu Links"
}
}
}
}
Then you need to handle it on your project.
We have a sample website with multiple menus. It's in react but available in other frameworks too.
How do you want to achieve this? More information would be helpful.
Thanks,
Priyanka
This doesn't answer the question I needed answering - which is much simpler. I just want to know how to identify the URL for a page I have created (via the repository interface).
Thanks in advance
I just wanted to check one more time as I have people chasing me to get this page live and I can't find the URL. Can you confirm that it is possible to identify the URL via the repository interface? Thanks in advance.
Nigel
Please @Prismic-Support-Team I have been trying to answer one simple question for four days? How do I find the URL of a new page I have created via the Repository interface?
Hello @chimni
Sorry for being delayed in the response. Most of our support engineers are on vacation.
If your page is live and you want to add that page URL in any text of the navigation bar, add a Link filed. There are three kinds of links in Prismic:
- Link to an external URL or web (Can also be used for mailto and tel links)
- Link to another document in the current Prismic repository.
- Link to a file in your Media Library (For example, a PDF, image, or audio file)
You can choose link to web option.
Thanks,
Priyanka
Priyanka
Thank you for the response but that doesn't answer my question. Where do I find the page URL?
Thansk in advance
Nigel
Hi @chimni
In my understanding, You created a page in prismic and published it. Now, you want to create a URL and write code according to your created page.
- After creating the page in Prismic, you get this page details in API browser response.
- From API browser response, you retrieve the page data and UID from JSON accordingly to your need.
- You use fetch queries to take the data from the API response.
If that does not answer your question, please share your repo and code, so that I can dig up more.
Thanks,
Priyanka
So you are saying that it is impossible to identify the URL of a new page within the Repo interface and you have to use the Command Line Interface? As someone who has been using Wordpress and Joomla for years that's crazy??
My repo is here:
https://chimni.prismic.io/documents/working?l=en-gb
The page I am trying to locate is called PDF download page.
Nigel
Hello @chimni
Yes, you can’t determine a page’s URL from the Prismic UI. To create a page URL, you need to create a link resolver function in your code. Are you a developer? If not, you might need a developer to make it.
I will let my @features-team know about the feature for future improvement.
Thanks,
Priyanka
I hope my beginner answer can help you.
In Prismic you have to make your own Router (let's call it sitemap), depending on the technology you are using, the Router can work on multiple different ways.
Is it not possible to have a "permalink" like on WordPress, because the content/data/pages on Prismic are all generated "dynamically", according the way you setup your Router and you want display content/data from the Prismic's API.
It will be very hard for someone to give you the URL you are looking for, without "deep diving" on your project.