How to generate a dynamic URL to a category page using a template manifest
Hello,
I'm using a help centre template and it has custom blocks that can navigate to another page when clicked.
We can put a URL in this custom block to link it to a category page called "Clients". However, we may not want it hard coded as that URL may change in the future, for example in the case it get’s deleted. I was wondering if there is a way we can call a function to generate this URL dynamically?
Thanks in advance!
-
Hey Tom99, why don't you use DC placeholder for this? You can add URL to your support and placeholder of that DC, you can paste here.
How to create DC?
Hope it worked for you.
Thanks
-
Hi Ifra,
Thanks very much for your response.
The url for this custom block needs to be set in the manifest.json file but it doesn't seem to allow for a dc variable, only a string?
This doesn't work...
Is there a way to add a dc variable in the manifest.json file? -
Hi, you need to add only clients_page_url instead of {{dc.clients_page_url}}
Remove curly braces and dc, it would be only clients_page_url
i). Your anchor tag should have setting's identifiers like this.
ii). Your manifest block should be like this.
iii). Then your setting in sandbox would be like this.
Thanks
-
Ohhh right! Thanks so much!
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
4 Kommentare