Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Static Publisher - <% control Menu(2) %> not working correct


Go to End


10 Posts   5965 Views

Avatar
Gutur

Community Member, 17 Posts

2 July 2009 at 7:49pm

Edited: 02/07/2009 7:50pm

Hello everyone,
StaticPublisher now works fine but there's one glitch left. The menu entries in the exported .html pages are not correctly highlighted.

<% control Menu(2) %>
    <li class="$LinkingMode"><a href="$Link" title="Link zur Seite &quot;$Title.XML&quot;">$MenuTitle.XML</a></li>
<% end_control %>

Always returns the very first menu entry as class="current" and the rest as class="link".
That works as expected in normal cms-mode (SiStri 2.3.1).

Thanks in advance for help :) /Carsten

Avatar
Gutur

Community Member, 17 Posts

4 July 2009 at 3:48am

ReHi,

just upgraded to 2.3.2 and still not working correctly. Seems like a bug to me as I can't find anything I did wrong or forgot to do.
Anyone has any experience with this? Could verify or falsify this bug?

Cheers /Carsten

Avatar
kheeteck

Community Member, 7 Posts

7 July 2009 at 3:48pm

Hi

I shared the same problem as you.

I think it is definitely a bug.

Is there anyway for the SilverStripe team to be notified of this bug

Avatar
Willr

Forum Moderator, 5523 Posts

9 July 2009 at 7:21pm

Please raise all issues as tickets on open.silverstripe.org

Avatar
martimiz

Forum Moderator, 1391 Posts

14 August 2009 at 7:10pm

This issue was raised before by someone who had a temp fix for it. Unfortunately I can't find the original post to give hime/her credit, so I'll give you what I found in my notes:

This is apparently caused by caching in DataObject::get_one(). The templating engine re-uses cached pageObjects, and it seems $LinkingMode is cached. One temp fix was to flush the cache in FilesystemDirector before rendering the next page. I have no idea about performance issues this might give, but here goes:

In FilesystemPublisher - line 53:

Requirements::clear();
$response = Director::test($url);
Requirements::clear();

replace by:

Requirements::clear();
singleton('DataObject')->flushCache();
$response = Director::test($url);
Requirements::clear();

Avatar
martimiz

Forum Moderator, 1391 Posts

14 August 2009 at 7:10pm

Edited: 14/08/2009 7:24pm

[EDIT] something went horribly wrong on my posts: I received an error on posting, so I tried again... After the last post finally succeeded I now have flushed this topic with multiple post I can't remove.... Really sorry, will edit all of them to make them smaller...

Avatar
Sam

Administrator, 690 Posts

18 August 2009 at 12:36pm

Hi Martimiz,

The issue you were having posting should have been fixed now.

Avatar
Gutur

Community Member, 17 Posts

19 August 2009 at 5:15am

Hi Martimiz, that did the trick, thanks a bunch! The Website is not so big anyway, so I can't tell if it's a hit on performance. I'm taking your note over to the bugtracker now ;)

Go to Top