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...

eZ debug

Timing: Jan 20 2025 03:09:24
Script start
Timing: Jan 20 2025 03:09:24
Module start 'content'
Timing: Jan 20 2025 03:09:24
Module end 'content'
Timing: Jan 20 2025 03:09:25
Script end

Main resources:

Total runtime0.1797 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0077 589.0859180.8125
Module start 'content' 0.00770.0067 769.898498.0547
Module end 'content' 0.01440.1651 867.9531527.8750
Script end 0.1795  1,395.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00392.1885200.0002
Check MTime0.00140.7891200.0001
Mysql Total
Database connection0.00110.626110.0011
Mysqli_queries0.125469.77971410.0009
Looping result0.00130.73611390.0000
Template Total0.164691.610.1646
Template load0.00110.592710.0011
Template processing0.163590.995610.1635
Override
Cache load0.00080.424110.0008
Sytem overhead
Fetch class attribute can translate value0.00100.542710.0010
XML
Image XML parsing0.00020.130810.0002
General
dbfile0.00864.7711200.0004
String conversion0.00000.002830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs