How do I get the text label of the category of the current page? getResources and Ditto do not seam to return this value. I am trying to set a class for my BODY tag to style the page, and Category seems like a natural way to do this.
-
☆ A M B ☆
- 2,475 Posts
Pages don’t have a category assigned to them by default. Chunks, templates, Snippets, plugins... all of those elements can be put into a single category via the GUI on the Elements tab, but a page (i.e. a resource) is not normally categorized.
You can use an Auto-Tag template variable to tag pages, which is similar in functionality. Maybe I’m misunderstanding you... could you explain more how you’re organizing your pages?
Thanks for your response.
I have a simple site with top level sections and 3 or 4 sub-pages. I want the category of the top level pages to be written into the body tag as a basis for styling. So I need some type of identifier that is common to all pages in the category. I would rather NOT use a TV unless I have to for simplicity (I already have a lot of TVs for other reasdons.)
If you’re not using the description, longtitle, or summary (introtext) fields, you could put something there.
Thanks for the responses and the explanation of Category. I resorted to another template variable, satisfied that I had exhausted other possibilities.