Forum Discussion
Yes, you're right, it only outputs CategoryPage for the page name (${page.name} is good to know).
This is a challenge for us because we have 2 pages which are both CategoryPage. How do we tell them apart with freemarker conditionals?
Can you do page.template-name? Because they use different templates.
Another thought is node.id, but I only saw an option for coreNode.id.
- Alan
If you need to know the name of a custom page that's being used for a particular node, you should be able to pull that information from the node settings. There are a series of settings in the "quilt" settings group that specify the name of the custom page being used. For a category page, the name of this setting is "quilt.categorypage". So then it's just a matter of retreiving the value via the REST API.
For example, let's say I have a category with id CategoryABC and for that category I've gone into the Category Admin and set Content > Custom Pages > Category Page to "CategoryPage.XYZ". If I make this REST API call:
/restapi/vc/categories/id/CategoryABC/settings/name/quilt.categorypage
Then I will get back a value of:
CategoryPage.XYZ
The process is similar for other page types (i.e. The Forum Page setting is "quilt.forumpage"). Just keep in mind that what you're essentially doing is retreiving the value that has been set for the node in the Community Admin.
Related Content
- 4 years ago
- 11 years ago
- 7 years ago