automatically assign another sections-id to a page?

Author Message

mario feichtinger

Friday 08 August 2003 1:05:27 am

hi!
i need help!!
how can i assign another sections-id to a page?
the page have e.g. the sections-id 1. but it should be changed in the template to sections-id 4. i know i can assign a the sections-id to the folder and all pages within have this id. but the folder should have the sections-id 1 and the pages should have the sections-id 4.
it is possible to do this?
in the template of the page, maybe:
{$node.object.section_id=4}
thanks
mario

Alex Jones

Friday 08 August 2003 6:54:19 am

I'm not sure how to do that in the template, but if you explain why you want to assign a different section to the pages we might be able to provide an alternate way of achieving your goal.

If your intent is to use a different tempalte for those articles than the standard template for that section you might be able to use a couple of matches within your override.ini file. For example, to match all articles (Id = 22 for example) within the section (1) you could use:

[my_override]
Source=node/view/full.tpl
MatchFile=my_override.tpl
Subdir=templates
Match[class]=22
Match[section]=1

Or, if you want to assign an override to all articles within a specific folder or node (103 for example) you could use:

[my_override]
Source=node/view/full.tpl
MatchFile=my_override.tpl
Subdir=templates
Match[class]=22
Match[parent_node]=103

There are many different ways of matching a file or set of files through the override.ini. More info is available at http://www.ez.no/developer/ez_publish_3/documentation/customization/custom_design/override_templates

Hope this helps, if not perhaps we can find a different way to solve the issue. :)

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

mario feichtinger

Friday 08 August 2003 7:26:37 am

hi!
thanks for your answer.
i don't want another template for the same class. i want another pagelayout for this class.
i have one folder with sectionid 1. the following pages in this folder should have the sctionid 4.
mario

Alex Jones

Friday 08 August 2003 8:02:05 am

Well, you should be able to change the page layout (which is a template) via this method. Change the Source=node/view/full.tpl line to Source=pagelayout.tpl in your override example and you should be good to go. For example I have several different page layouts in my override.ini including:

[pagelayout_steelchart]
Source=pagelayout.tpl
MatchFile=pagelayout_steelchart.tpl
Subdir=templates
Match[node]=842

[pagelayout_knives]
Source=pagelayout.tpl
MatchFile=pagelayout_knives.tpl
Subdir=templates
Match[section]=1

If you want to use a teamplate that you have already created for section 4 you can use that as your MatchFile, so you don't have to recreate it.

Does this help?

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

mario feichtinger

Friday 08 August 2003 8:38:16 am

unfortunately i believe no.
i try to explain it more clearly. if i can.
i have a link to a page (../content/view/ext_kandidaten/167). this is a extension template.
the content of this ext template:
{let liste_id=168}
{let children=fetch('content',list,hash(parent_node_id, $liste_id))}
{section name=Child loop=$children}
{node_view_gui view=line content_node=$Child:item}
{/section}
{/let}

the line template show a list of pages in the folder with the sectionsid 1. all this pages in this folder should be displayed in the sectionsid 1. these pages have links to itself for printpages. and these links should be displayed in sectionsid 4!

content of line_kandidaten.tpl:
....
openWindow('http://.../content/view/ext_person/{$node.node_id}','','')
....

any idea??

mario

Alex Jones

Monday 11 August 2003 7:48:52 am

Mario, I'm not quite sure how to do this via eZ publish code. One question, are you just trying to provide printable pages for your site, or do you need other section-specific information for these pages? I ask, because if all you need is nice printable pages I think you would be better off using CSS and alternate style sheets to solve the goal.

Some more information about CSS printer-friendly pages check out:
http://www.alistapart.com/stories/goingtoprint/
http://www.meyerweb.com/eric/articles/webrev/200001.html

If this isn't doesn't solve your problem, perhaps someone else can give you a helpful answer. :)

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

mario feichtinger

Monday 11 August 2003 8:29:18 am

hi alex!
i was blind.
now i have changed the override.ini which you already tried to explain me in a reply before.
[pagelayout_kandidaten]
Source=pagelayout.tpl
MatchFile=pagelayout_kandidaten.tpl
SubDir=templates
Match[class]=48

and it works.

many thanks!
mario

Alex Jones

Monday 11 August 2003 8:38:04 am

Great!

We all have those moments when we seem to miss the obvious. I am glad to hear you have solved the problem.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

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 18 2025 19:31:01
Script start
Timing: Jan 18 2025 19:31:01
Module start 'layout'
Timing: Jan 18 2025 19:31:01
Module start 'content'
Timing: Jan 18 2025 19:31:02
Module end 'content'
Timing: Jan 18 2025 19:31:02
Script end

Main resources:

Total runtime0.6467 sec
Peak memory usage4,096.0000 KB
Database Queries72

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 589.2578152.6406
Module start 'layout' 0.00720.0029 741.898439.4766
Module start 'content' 0.01020.6354 781.3750608.1641
Module end 'content' 0.64560.0011 1,389.539120.1250
Script end 0.6467  1,409.6641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.6280160.0003
Check MTime0.00140.2105160.0001
Mysql Total
Database connection0.00090.138210.0009
Mysqli_queries0.571388.3309720.0079
Looping result0.00090.1399700.0000
Template Total0.604293.420.3021
Template load0.00200.314120.0010
Template processing0.602293.111920.3011
Template load and register function0.00010.018410.0001
states
state_id_array0.00430.659610.0043
state_identifier_array0.00180.277920.0009
Override
Cache load0.00180.2721970.0000
Sytem overhead
Fetch class attribute can translate value0.00060.089820.0003
Fetch class attribute name0.00090.145990.0001
XML
Image XML parsing0.00060.099920.0003
class_abstraction
Instantiating content class attribute0.00000.0037120.0000
General
dbfile0.00080.1170160.0000
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 40
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs