• Core User Interface
• Date & Time
• File MIME Types
• Location Lists
• RSS Feeds
• Sending Mail
• Spell Checking
• Unique String Identifiers
I have searched extensively and all I keep finding are Forum posts about different auto nav set-ups with people including this line in their code without explanation:
$nh = Loader::helper('navigation');
and other threads where people advise "don't forget to call the navigation helper" and a few comments about the navigation helper such as, "strangely, this appears to be absent in the documentation."
I apparently need to use it for a PAGE LIST, which doesn't seem like it should be part of a navigation helper, really, and I'm not the first person who has been asking about documentation of this, so can we get some info in this thread about it, please? Thanks.
Based on that link, I have no clue how I would use that to achieve anything others have been suggesting to me in various threads.
Where do I insert the line of code, in my template or my view.php for the custom template I'm building? Then what? Apparently that gives me three methods to work with, but how? Some examples would be nice.
Take this for example... someone gave me the following custom PageList template instructions:
"I think the main bit you are after, slimmed right down to the essentials just be sure to include the navigation helper"
This was supposed to give me a PageList block with an output of
<<previous 1 2 3 4 5 etc... next >>
So that the page titles are replaced with numbers.
But, all I get is an error message.
* Get the URL of a page
* Get a link to a page
* Get the breadcrumbs for a page
For all this you need to know the Collection ID of the page in question.
So a very basic template that just prints the URL of the current page would be for example
<?php $c = Page::getCurrentPage(); $nh = Loader::helper('navigation');?> The current URL is: <?php echo $nh->getCollectionURL($c) ?>
Also, do you see any way this can be integrated with a custom PageList block? Or was this person likely giving me a custom Auto Nav block instead and just forgot to mention it?
Note that you can also get page url's via a path by using the View::url() function, for example:
...which is the same as this:
<?php $page = Page::getByPath('/about/employees'); $nh = Loader::helper('navigation'); $nh->getCollectionURL($page); ?>
@zoinks - I don't think there's that much downside to including the helper if you don't need it (like you said, just a fraction of a millisecond, but it's probably already being loaded elsewhere in the stack so maybe not even that).
I have a PageList custom template available that is functionally the same as the built-in C5 template, but the code is much easier to work with, and is also commented to show you how to do different things with it -- might be helpful to you:
I think I know enough now to try to use this custom PageList template. Hope so...