The right way to build a nav?

Author Message

Peter Bailey

Monday 31 March 2003 12:58:25 pm

Hey all

I've discovered recently that I can get quite a bit done just using the template operators and functions, but can't help but feel like I'm giving too much power to the templates.

First, some data. Here's an example folder

My Folder
>> Articles
>> >> Customer Success Stories
>> >> Technical Solutions
>> >> Editorials

From this, I would like to create the following

<ul>
<li><a href="/content/view/sitemap/243/">Customer Success Stories</a></li>
<li><a href="/content/view/sitemap/244/">Technical Solutions</a></li>
<li><a href="/content/view/sitemap/245/">Editorials</a></li>
</ul>

Also, the sitemap view isn't what I really want, but

Now, I'm assuming it would be better to add some PHP to index.php to build an object of data that I access in the template instead. I admit, opening index.php I feel a bit lost.

Am I in the correct line of thinking?

Kai Duebbert

Monday 31 March 2003 5:49:21 pm

My experience:
I've built 5 sites with eZ publish 2.2.x and to do what you want to do, I *had* to dive into the PHP code of eZ publish. I can assure you that you don't want to do that!

It's not that the code is bad (it's written very cleanly unlike most other open source CMS), BUT you will run into big problems, if you want to update the system to a new version of eZ publish which you will want to do in the future. You will have to track down all the changes you did and do/adapt them again.

Even though this problem can be circumvented, you will have much better (and more portable!) results by using the templates (which should stay compatible with new releases).

The new template system is great and gives you a lot of power. Use it!

Just my 2 cents.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 19:53:32
Script start
Timing: Jan 30 2025 19:53:32
Module start 'layout'
Timing: Jan 30 2025 19:53:32
Module start 'content'
Timing: Jan 30 2025 19:53:32
Module end 'content'
Timing: Jan 30 2025 19:53:32
Script end

Main resources:

Total runtime0.0252 sec
Peak memory usage8,192.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.1328151.2109
Module start 'layout' 0.00470.0034 739.3438220.6875
Module start 'content' 0.00800.0156 960.0313997.6797
Module end 'content' 0.02360.0015 1,957.710929.9922
Script end 0.0252  1,987.7031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002610.3640140.0002
Check MTime0.00104.0350140.0001
Mysql Total
Database connection0.00072.954810.0007
Mysqli_queries0.00207.767130.0007
Looping result0.00000.035010.0000
Template Total0.00114.210.0011
Template load0.00083.304110.0008
Template processing0.00020.901310.0002
Override
Cache load0.00062.450210.0006
General
dbfile0.003614.347080.0005
String conversion0.00000.025640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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