Jump to:

23358 Posts in 17875 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » SiteConfig customisation results in error on save

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 443 Views
  • jizzman
    Avatar
    Community Member
    23 Posts

    SiteConfig customisation results in error on save Link to this post

    Hi,

    I'm trying to get my site live for the first time. When I save my CustomSiteConfig I get an error. Firebug says:

    "You don't have permission to access <site>/admin/RootForm on this server."

    I've tracked it down to this field I added. Remove this and the error goes away.

    $navViewer = new HtmlEditorField_Readonly('NavMenu_', 'Navigation');
    $fields->addFieldToTab('Root.NavigationMenu', $navViewer);

    I have my own code to generate a navigation menu (onbeforeWrite()) and save the HMTL result in the SiteConfig table. I was just trying here to show a read-only view of the generated menu (I was thinking of adding a proper 'generate' button). With a fresh installation, the very first save works, but after that it wont work again. I never had this problem on my dev machine.

    Any clues?

    Cheers,
    J

  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: SiteConfig customisation results in error on save Link to this post

    I don't know - I suspects it's something that is based on file paths and seperators - assuming you are using a unix machine for live and an non-unix machine for dev.

    However - I'm really not sure why you wouldn't do the normal thing and use the templating engine for rendering page elements - it's what it is there for and I've never had an issue creating many different types of menus...

  • jizzman
    Avatar
    Community Member
    23 Posts

    Re: SiteConfig customisation results in error on save Link to this post

    Hi,

    I would like to do the normal thing! I had a need to create drop down menus where the 2nd level would sometimes be child pages (directly supported by SS) but sometimes be heading anchors on a root level page (not directly supported by SS, as far as I know). So I wrote a little bit of code to parse the page, find the heading anchors, and generate a list for my menu. Worried about the site growing and performance (which admittedly I have little experience with) I save the generated menu to the database. I'm happy with the result, but is there an easier way?

    Thanks,
    J

    P.S. As for Windows vs Linux: I rebuilt the database manually - from scratch - on the Linux server to 1) test my CMS development 2) avoid any Window path problems. Apart from a css include path problem in my page_controller::init() I've had no other cross-platform issues.

  • martimiz
    Avatar
    Forum Moderator
    1067 Posts

    Re: SiteConfig customisation results in error on save Link to this post

    If it's just the performance you're worried about, you could consider using partial caching for your menu's (http://doc.silverstripe.org/sapphire/en/reference/partial-caching).

    The only cactch is that menu's might not update right away after every change - but I suppose, if it were very important, some clever coding could handle that.

    443 Views
Page: 1
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.