Forums / Setup & design / new section / new template

new section / new template

Author Message

John Mina

Tuesday 16 March 2004 4:21:10 am

HI
Now i belive that the sections were created so that when i create folder and i want to view this fodler in a special way. i create a section that will be related to the template that i wil lcreate to view that folder.

Knowing that i didn't create a new class for this.

IS that correct?

so if yes,
I created a fodler "New Fodler" then i put some images inside, and i need to create a template for that folder that will view the pix inside the folder in a special way. so i can't use the folder.tpl as it is for showing all the folders.
Any idea about how this could be done?

Alex Jones

Tuesday 16 March 2004 6:46:18 am

You are correct in your understanding of sections. Though is you only want to override one folder, you don't have to create a new section. You could choose to override the template for that one folder with a node override instead. For example, either of the two following examples would allow you to override the folder view when placed in your <i>override.ini.append</i>. Note, you will need to change <i>your_special_folder</i> and the node/section ID to match your set up.

<b>Example 1</b>
[your_special_folder]
Source=node/view/full.tpl
MatchFile=<i>your_special_template</i>.tpl
Subdir=templates
Match[node]=<i>23</i>

<b>Example 2</b>
[your_special_folder]
Source=node/view/full.tpl
MatchFile=<i>your_special_template</i>.tpl
Subdir=templates
Match[section]=<i>5</i>

Documentation: http://ez.no/ez_publish/documentation/customization/custom_design/override_templates

Alex

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

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

John Mina

Thursday 18 March 2004 5:31:06 am

Thanks a Lot Alex
i found that the problem was the order of writting the sections in the ini file
tha tcould be also adjusted in the priority box from thes etup interface
THanks Again

Alex Jones

Thursday 18 March 2004 7:21:24 am

Glad to hear you solved it. The order of overrides seems to cause a lot of problems for people. I know it has gotten me in trouble a couple of times. ;)

Alex

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

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

poon sg

Friday 05 November 2004 12:26:17 am

Hi,
Sorry, I clicked the topic.
yes , I also don't want to create a section just in order to override a folder, but I met another problem: if I want to let the user to remove or edit self created files,the override template can't works.

1)I let the user have the authority to create,edit or remove
2)Add the corresponng program in specifal_file_line.tpl
3)Modify the override.ini.append file

[specifial_file_folder]
Source=node/view/full.tpl
MatchFile=specifal_file_folder.tpl
Subdir=templates
Match[node]=202

[specifial_file_line]
Source=node/view/line.tpl
MatchFile=specifal_file_line.tpl
Subdir=templates
Match[node]=202

The"the_specifial_file_folder" works fine, but the "specifial_file_line" can't work, still use default file_line.tpl. but if I created a section for the specifial folder, and modified the override.ini.append file as below,is works fine.

[specifial_file_line]
Source=node/view/line.tpl
MatchFile=specifal_file_line.tpl
Subdir=templates
Match[section]=18
Match[class]=12

Is it possible if I don't create a section to let the specifial_file_line.tpl works fine for the specifial folder?

any hint or code will be high appreciate.

regards!
SGpoon