Jump to:

5520 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Static Publisher - <% control Menu(2) %> not working correct

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

Page: 1 2
Go to End
Author Topic: 4047 Views
  • Gutur
    Avatar
    Community Member
    17 Posts

    Static Publisher - <% control Menu(2) %> not working correct Link to this post

    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

  • Gutur
    Avatar
    Community Member
    17 Posts

    Re: Static Publisher - <% control Menu(2) %> not working correct Link to this post

    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

  • kheeteck
    Avatar
    Community Member
    7 Posts

    Re: Static Publisher - <% control Menu(2) %> not working correct Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5490 Posts

    Re: Static Publisher - <% control Menu(2) %> not working correct Link to this post

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

  • martimiz
    Avatar
    Forum Moderator
    1068 Posts

    Re: Static Publisher - <% control Menu(2) %> not working correct Link to this post

    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();

  • martimiz
    Avatar
    Forum Moderator
    1068 Posts

    Re: Static Publisher - <% control Menu(2) %> not working correct Link to this post

    [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...

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Static Publisher - <% control Menu(2) %> not working correct Link to this post

    Hi Martimiz,

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

  • Gutur
    Avatar
    Community Member
    17 Posts

    Re: Static Publisher - <% control Menu(2) %> not working correct Link to this post

    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 ;)

    4047 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.