navigation & cgsimple smarty

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
thomsonson
Forum Members
Forum Members
Posts: 39
Joined: Wed Aug 24, 2011 9:47 am

navigation & cgsimple smarty

Post by thomsonson »

I have the following code:

Code: Select all

{$cgsimple->get_sibling("prev","prev_sibling")}{if !empty($prev_sibling)}{cms_selflink page="$prev_sibling" text="Previous"}{/if}
<br>
{$cgsimple->get_sibling("next","next_sibling")}{if !empty($next_sibling)}{cms_selflink page="$next_sibling" text="Next"}{/if}
on the template for these pages:
http://dronedog.com/index.php?page=album-page-1

What I am looking to do is have both the prev and next links remain visible on the first and last of the Level 2 sibling pages and link, respectively, the the last and first pages. I have an equivalent example of this working within the Album module. Here is the code:

Code: Select all

{if $link.picture.previous}<a href="{$link.picture.previous}" title="previous picture"><&nbsp;</a>{else}<a href="{$link.picture.last}"><&nbsp;</a>{/if}
picture {$picturenumber}/{$picturecount}
{if $link.picture.next}<a href="{$link.picture.next}" title="next picture">&nbsp;></a>{else}<a href="{$link.picture.first}">&nbsp;></a>{/if}
It seems like it would be possible to do the same thing for actual pages with CGSimple Smarty, but I'm getting stumped with this!

Secondly, is it possible to use simple smarty or something else to output the total number of Level 2 children of a particular parent page, and the position of the current page within that group of siblings? (ie page 2 of 3, etc)

I have managed to do this for the whole site (all pages), but this is no good, as the count and position output needs to be limited to just the Level 2 children of a given parent page (as opposed to all Level 2 pages)

thanks!
Post Reply

Return to “Layout and Design (CSS & HTML)”