Hi - having a little diffciulty getting my head around the page URL template code.
I have a page set up that is not published - it is a draft page that can be accessed by a “secret link”.
The page lists a bunch of items that have a detail page.
I want to put a link on each detail page that takes me back to the master draft page.
I think I am supposed to “find” the draft page in some way and then output its URL including the token, but I am not getting anywhere.
Forgive if this is really basic stuff, but not for me!
Unfortunately not - that wants to take me back to the overall master list.
My set up is: A master list - then I assign certain items to a “private page” (in the panel as a catergory)
This works great.
So the private page only contains the items that have this category.
Not sure if that is the problem.
So, yes this works, as ‘hard-coded’ way - what I was hoping for was a way to insert the ‘page ID’ or its URL into the code - from the panel - so that i could modify it per private page - (I have several)
e.g.
kirby()->page(‘URL-of-private-page-inserted-from-blueprint’)->url()
And if I wanted to add it only once - in the blueprint of the private page - what would the resulting template code be? This is the bit that is hard for me to figure out!
Maybe I’m missing something here, the structure is not clear to me. What is the relationship between the private page and the pages listed on each private page?
Here is my structure (and maybe this is where I am going all wrong - but it works up to a point).
My content folder contains a folder:
artworks
this contains a hundred individual artworks:
1_artwork_1
2_artwork_2
etc…
then I have several “private pages” (as draft pages) in addition to a master “work” (published) page: these are templates:
work.php
privateview1.php
privateview2.php
etc…
I have an artworkmaster.php snippet that each page uses (private or not) - (perhaps this is also where I am going wrong). This contains the following pagination for example:
So the privateview to use (1 or 2 or maybe more) depends on the category? But is this a 1:1 relation, or can artwork x belong to multiple views both public and private?
In that case, the easiest option would be to use a query string in the URL that leads to the single page indicating the parent, and read that query string in the single page to return back to the previous page. Or you use some Javascript via data attributes. Or session data. I think referrrers are not reliable.
Edit: If I think about it, you are already passing the parent via the category, right? So if param(‘category’) is privateview, the parent is the privateview page? Then that would solve it.
yes I am passing param category privateview already -
so I need help with the link code to include it.
I am sure it is some variation of what I have but I am struggling a bit with brain fog!