Forums / Setup & design / Topmenu in Website Interface

Topmenu in Website Interface

Author Message

Maarten Holland

Sunday 04 November 2007 2:39:54 am

Hi all,

I'm using ezPublish 3.10.0 with ezwebin 1.2.0.

I've created two siteaccess for different sites that share the same database. Is it possible to tell ezPublish to show items from a specific folder in it's top menu?

I've noticed the following line in /extension/ezwebin/design/ezwebin/templates/menu/flat_top.tpl:

{def $root_node=fetch( 'content', 'node', hash( 'node_id', $indexpage ) )

It appears to me as if ezPublish tries to use the IndexPage that's set in site.ini.append.php as the root for the top menu. That's exactly what I need, but this doesn't work properly. It seems as though the flat_top.tpl template isn't used at all: When I remove it's contents and clear all caches, the menu still shows up.

Any tips would be greatly appreciated.

Thanks.

Maarten

Vicente Olivan

Monday 05 November 2007 2:35:16 pm

Hi Maarten,
Checks RootNode, IndexPage, DefaultPage and PathPrefix parameters for your setup, in the siteaccesses.

See: http://ez.no/developer/forum/install_configuration/configuration_of_12_sites_with_one_admin

Good luck

Maarten Holland

Tuesday 13 November 2007 2:25:20 pm

Vicente,

Thank you very much for your reply. I forgot to 'track changes' so didn't notice someone replied until now.

Unfortunately, the problem still persists. I've checked the values of the settings you've mentioned and they all seem correct to me.

The PathPrefix/IndexPage work fine since the desired node shows up when accessing the 'root URL'.

The problem only appears in the topmenu, where ezPublish lists the items that are in it's root or 'home' folder, instead of the folder I've specified in 'IndexPage', even though 'flat_top.tpl' contains the ini parameter 'indexpage' that I've set to the right node.

I would really LOVE to solve this, so I hope you or anyone else can give me another hint about what I've done wrong.

Thank you for your time,

Maarten

Maarten Holland

Tuesday 13 November 2007 2:32:04 pm

BTW: I've just noticed something else:

When accessing the front page or one of my own content objects below, the topmenu is wrong.

But, when accessing a system URL like /user/register or /content/tipafriend the topmenu reflects the right content of my IndexPage/DefaultPage Node.

Perhaps someone knows what this means?

Vicente Olivan

Friday 16 November 2007 1:49:34 pm

Hi Maarten

Change yours settingns in each siteaccesses (menu.ini.append.php):

[Topmenu_content]
URL[]
URL[default]=content/view/full/2

by

[Topmenu_content]
URL[]
URL[default]=content/view/full/<your_main_node>

André R.

Saturday 17 November 2007 4:42:55 am

When accessing the front page or one of my own content objects below, the topmenu is wrong. 

But, when accessing a system URL like /user/register or /content/tipafriend the topmenu reflects the right content of my IndexPage/DefaultPage Node.

You need to specify the correct "RootNodeDepth" setting, it's the one used when you are browsing nodes.

Set it to 2 instead of 1, given that your site is structured like this:

root
|
-site1
|
-site2

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Maarten Holland

Sunday 18 November 2007 2:53:59 am

Thank you very much for all your replies. I'm getting closer, but am not quite there. Here's my current setup:

 site.ini.append.php:

 [SiteSettings]
 IndexPage=/content/view/full/474
 DefaultPage=/content/view/full/474
 RootNodeDepth=2

 content.ini.append.php:
 [NodeSettings]
 RootNode=474

When I leave the line in flat_top.tpl untouched:

 

     {def $root_node=fetch( 'content', 'node', hash( 'node_id', $indexpage ) )
 

Then the LEFT menu is good, but the TOP menu shows the contents of node 2 instead of 474. However, when I visit a system URL it does show the contents of root 474.

When I change the line in flat_top.tpl to:

 

     {def $root_node=fetch( 'content', 'node', hash( 'node_id', ezini( 'NodeSettings', 'RootNode', 'content.ini' ) ) )
 

Which should do the same IMO, than the LEFT menu is empty but the TOP menu does show the right contents of node 474, regardless whether I visit one of my own content objects or a system URL.

I'm completely lost now. Hope you can help me out again!

Thanks for your time,

Maarten

André R.

Tuesday 20 November 2007 1:49:57 am

I have reported this as a bug: http://issues.ez.no/IssueView.php?Id=12004&activeItem=1
Just override the templates to your own will in the mean time, and feel free to comment on the issue if you want.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom