Share » Forums » Setup & design » automatically assign another...

automatically assign another sections-id to a page?

automatically assign another sections-id to a page?

Friday 08 August 2003 1:05:27 am - 7 replies

Modified on Friday 08 August 2003 1:58:07 am by mario feichtinger

Author Message

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>

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu