22401 Posts in 6852 Topics by 2748 members
|Go to End|
30 March 2012 at 1:19am
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');
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.
4 April 2012 at 5:36am
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...
4 April 2012 at 12:31pm Last edited: 4 April 2012 2:21pm
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?
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.
4 April 2012 at 8:35pm
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.
|Go to Top|