How can I check whether the page in <cms:pages... is the first page in loop?
Is it also possible to get a value from the first page that would be listed outside the cms:pages loop?
- what I want to do is first to add the first section an "active" html class
- 2nd to use the variable "background_image" from the first page for the "body" html tag
I guess the page ID is not a reliable variable to check for since pages could be deleted. So what's the best practice to do so in couch cms? Or would it be better just to use native php function?
Is it also possible to get a value from the first page that would be listed outside the cms:pages loop?
- what I want to do is first to add the first section an "active" html class
- 2nd to use the variable "background_image" from the first page for the "body" html tag
I guess the page ID is not a reliable variable to check for since pages could be deleted. So what's the best practice to do so in couch cms? Or would it be better just to use native php function?
- Code: Select all
<body style="background-image: url(<cms:show background_image/>);">
<!-- background from first page -->
<cms:pages masterpage='section.php' orderby="section_position" order="asc">
<section id="<cms:show k_page_name/>-section" class="project full-height" data-background="<cms:show background_image/>">
<!-- content goes here -->
</section>
</cms:pages>