Forums / Setup & design / footer depending on node.

footer depending on node.

Author Message

risto CMS user

Tuesday 15 November 2005 6:30:51 pm

Hi i'm in a bit of a picle here. I have a site with several "main" nodes. and I need the different "main" nodes and their subnodes to user different footers.

can someone point me to how to accomplish this?

I'm getting thish is where it should be done. Just don't get how.
pagelayout.tpl
nodesid
overrides
footer1.tpl
footer2.tpl
footer3.tpl

Nathan Kelly

Tuesday 15 November 2005 9:53:25 pm

Hi, you could try a conditional include like this:

{if $module_result.node_id|eq(10)}

{include uri="design:footer1.tpl"}

{elseif $module_result.node_id|eq(11)}

{include uri="design:footer2.tpl"}

{else}

{include uri="design:footer3.tpl"}

{/if}

Obviously you will need to change the node id's to suit, better yet make your main nodes sections, http://ez.no/doc/ez_publish/technical_manual/3_6/concepts_and_basics/content_management/sections i.e. "section1", "section2" and "section3" (use descriptive names for section names), then do the same as above but like this:

{if $module_result.section_id|eq(1)}

{include uri="design:footer1.tpl"}

{elseif $module_result.section_id|eq(2)}

{include uri="design:footer2.tpl"}

{else}

{include uri="design:footer3.tpl"}

{/if}

If you need more than 3 footers you should use a switch for this. http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_control_structures/conditional_control/switch

If thats not what you are after you could use overrides with sections, make your sections as before then in "settings/siteaccess/[sitename]/override.ini.append.php" do something like:

[section_one_footer]
Source=footer.tpl
MatchFile=override/templates/footer1.tpl
Subdir=templates
Match[section]=1

[section_two_footer]
Source=footer.tpl
MatchFile=override/templates/footer2.tpl
Subdir=templates
Match[section]=2

[section_three_footer]
Source=footer.tpl
MatchFile=override/templates/footer3.tpl
Subdir=templates
Match[section]=3

Overrides could be the best solution but for similar things I have used conditional statements with no problems, hope that helps.

Cheers!

Pardon me while I burst into flames...

risto CMS user

Wednesday 16 November 2005 1:45:03 am

Nathan Kelly this all looks very nice.

But I have serveral problems.

1: If i set footer depending on node, then it will not be displayd in subnodes. very sad because I almost had it here.

2: when i set a different/new section this content disapears for anonymous users. also very sad.

And yous I'm a total noob when it comes to eZ.
Any further help on both issues would be greatly appreciated

Nabil Alimi

Wednesday 16 November 2005 4:52:59 am

What do you mean by "the content dissapears" ?

Anonymous users gets an error when trying to access it ?

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Nathan Kelly

Wednesday 16 November 2005 2:54:43 pm

Ok if your sections can't be seen by anonymous users you need to give them access to the newly created sections.

Go to Setup -> Roles and policies: in the admin interface, and select the anonymous role, you need to include your newly created sections, you should have something like this at the moment:

content	read	Section( Standard )
content	pdf	Section( Standard )
rss 	feed 	No limitations
user 	login 	SiteAccess( sitename )

What you need is something like this:

content	read	Section( Standard, section1, section2, section3 )
content	pdf	Section( Standard, section1, section2, section3 )
rss 	feed 	No limitations
user 	login 	SiteAccess( sitename )

To do this click the edit button, then select the edit button for "content, read" you will see three multi-select lists. To include your new section go to the second list named "section" and you should see your three new sections in the list, to select all of your new sections control + click until they are all highlighted, standard section too.

Do the same for "content, pdf" and then save the role, now clear the cache and anonymous users should now be able to see your new sections.

Hope this helps!

Cheers!

Pardon me while I burst into flames...

risto CMS user

Thursday 17 November 2005 7:29:11 am

thax, works perfevtly. I'm so happy now.

And the new "issue"
Is there a way of limiting the "accesspoint" of the left menu depending on what section the reader is at?

Nathan Kelly

Thursday 17 November 2005 2:44:47 pm

I'm not really sure what you mean? Could you give me a more detailed description of what you are trying to do?

Cheers!

Pardon me while I burst into flames...

risto CMS user

Friday 18 November 2005 1:40:50 am

ok lets use the standars setup.

we have Galleries, Polls and Contacts

Now what Im trying to doo is in the left menu only display the content of these "directories"

left menu when I'm in galleries

Galleries
   - Misc flowers
   - Landscape

when im in Misc flowers leftmenu shoul look like this:

Misc flowers
   - Yellow flower
   - Purple Haze
   -  Blue flower

And another thing. how gan I make it so articles are displayed in leftmenu but only at a sertain node?

Nathan Kelly

Sunday 20 November 2005 3:11:44 pm

Hi risto, what you are trying to do sound fairly straight forward.

The first thing I would suggest is you start reading through some of the new docs http://ez.no/doc, there are tonnes of examples that can help you do what you need.

For your menus you should look at the tree and list functions:
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/tree
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/modules/content/fetch_functions/list

You should also look at overrides, get to know how they work and most of the things you need to do will be made simpler, for instance displaying articles only on a certain node:
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/configuration_files/override_ini

Unfortunately I can't show you step by step how to do these things because I don't know how you have set your site up, so reading the docs is your best bet.

Cheers!

Pardon me while I burst into flames...