Forums / Setup & design / Next and previous links on basic info pages?

Next and previous links on basic info pages?

Author Message

Nathan Kelly

Tuesday 06 September 2005 9:58:31 pm

Hi there, once again I have searched till my fingers are numb with no luck for the answer to a simple problem.

I need to allow users to navigate through certain areas of a website with the use of "<Previous | Next>" style navigation as an alternative to the navigation.

Scenario: -

My directory structure looks something like this...

Root Node
|
|--About Us
|  |--Mission Statement
|  |--Company History
|  |--Services
|  |--ETC.
|  |--ETC.
|
|--|Products
|  |--Pages

ETC, ETC.

In the About Us section I'd simply like to add the alternative navigation at the bottom of each page...

|------header------|
|------Nav bar-----|
|------content-----|
|                  |
|    <alt nav>     |
|------------------|
|------footer------|

When you view the the first page there should not be a previous link, last page no next link.

I have found some info regarding the /templates/navigator/simple.tpl template and I have tried to use it as it seems to be just what I need but for the life of me I have no idea how to make it work.

I have tried suggestion from this post http://ez.no/community/forum/setup_design/how_to_get_next_previous_and_numbered_page_links
But I'm not really sure how the offsets and such work, and the only thing I have had working is the previous button but it links to the root node no matter what page I'm on.

Can anyone point me to any better examples of how this can be done?

Pardon me while I burst into flames...

Nathan Kelly

Tuesday 06 September 2005 10:41:50 pm

I have found some more info on this in the old documentaion here http://ez.no/products/ez_publish_cms/documentation/customization/tips_tricks/improve_the_pagelayouttpl
But I'm still unable to make much sense of it.

Another thing I should add is the fact that I am redirecting my "About Us" link to the "Mission Statement" page, this is because there is no content on the "About Us" page.

The reason I mention this is that I'm not sure if it will effect the navigator, being that the "About Us" node is the parent of the pages that will need the navigator?

Cheers!

Pardon me while I burst into flames...

Nathan Kelly

Wednesday 07 September 2005 5:02:47 pm

Can anyone help me on this? Have I made my intention clear enough?

This seems like it should be simple enough to achieve but my skills with the ez publish template language are poor at best, any guidance at all will help.

Cheers!

Pardon me while I burst into flames...

Nathan Kelly

Thursday 08 September 2005 12:56:12 am

Well after 2 days of trying I finally gave up on the navigator idea and instead created a custom tag to do the job...

As much as I would like this to be dynamic it seems it's just not possible, so the custom tag was my only option. If anyone is interested this is what I have done...

XML Block input:

<custom name="pages" next="about/services" back="about/mission_statement">

</custom>

And the template:

<ul class="related-pages">
{section show=$back}<li><a href={$back|ezurl}>&laquo;&nbsp;Previous</a></li>{/section}
{section show=$next}<li><a href={$next|ezurl}>Next&nbsp&raquo;</a></li>{/section}
</ul>

<i>I'm currently using the</i> <b>|ezurl</b> <i>string for the href attribute because I couldn't find the correct way to reference the node directly, the</i> <b>eznode://63</b> <i>string outputs as just that and ezpublish dosn't seem to like that. If you know a way to reference the node directly</i> (not content/view/full/63 style) <i>like the embed tage does, please let me know, I think it would be a cleaner way to do it.
</i>
And in the content.ini.append.php:

[CustomTagSettings]
AvailableCustomTags[]=pages

I now have to explain to my client how to add the links manually which is disappointing, but at least it works, for the time being. I'm still open to suggestions on how this could be done dynamically though.

Cheers!

Pardon me while I burst into flames...