Forums / Setup & design / automatically assign another sections-id to a page?

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>

eZ debug

Timing: Jan 18 2025 15:52:54
Script start
Timing: Jan 18 2025 15:52:54
Module start 'content'
Timing: Jan 18 2025 15:52:55
Module end 'content'
Timing: Jan 18 2025 15:52:55
Script end

Main resources:

Total runtime1.0247 sec
Peak memory usage4,096.0000 KB
Database Queries209

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.9766180.8125
Module start 'content' 0.00620.8841 769.7891609.2578
Module end 'content' 0.89030.1343 1,379.0469341.0547
Script end 1.0246  1,720.1016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4122210.0002
Check MTime0.00150.1459210.0001
Mysql Total
Database connection0.00090.085610.0009
Mysqli_queries0.925790.33552090.0044
Looping result0.00210.20952070.0000
Template Total0.999897.620.4999
Template load0.00200.192220.0010
Template processing0.997897.372920.4989
Template load and register function0.00020.019010.0002
states
state_id_array0.00070.066410.0007
state_identifier_array0.00060.061620.0003
Override
Cache load0.00190.1832970.0000
Sytem overhead
Fetch class attribute can translate value0.00140.132430.0005
Fetch class attribute name0.00210.200490.0002
XML
Image XML parsing0.00100.100230.0003
class_abstraction
Instantiating content class attribute0.00000.0036120.0000
General
dbfile0.00320.3115270.0001
String conversion0.00000.000730.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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