10377 Posts in 2192 Topics by 1709 members
| Go to End | Next > | |
| Author | Topic: | 6169 Views |
-
New Module: Custom Menus

24 February 2010 at 3:00am Last edited: 24 March 2010 10:52pm
Hi All,
Just thought I would announce that I am releasing a new module for your scrutinizing. Basically, it allows you to create custom navigation menus (such as "Header", "Footer" etc) and then link to these menu's from your template using <% control CustomMenu(menuslug) %>.
Its still pretty basic, but lets you build a menu from a TreeMultiselectField, give that menu a slug and return a DataObjectSet of pages to your template when called.
In the future I plan to add Versioning support, but any suggestions welcome
.
Download link: http://www.assembla.com/spaces/silverstripe-modules/documents/dQoxrEiiar37wFeJe5afGb
Browse Source: http://www.assembla.com/code/silverstripe-modules/subversion/nodes/custommenus
SVN Trunk: http://subversion.assembla.com/svn/ssmodules/custommenus/trunkI look forward to any feedback.
Mo
Edit Just noticed the svn link above isn't correct, have changed it now. Also, added direct link to SVN trunk.
Edit Changed SVN link to proper link
. -
Re: New Module: Custom Menus

24 February 2010 at 2:49pm
I couldn't tortoiseSVN it, but pulled the zip and having a peak. Looks good - one little thing, it might be a good idea to change:
<?php
class CustomMenu extends Extension {
public function CustomMenu($menu = null) {
if($menu) {
if(DataObject::get_one('CustomMenuHolder',"Slug = '$menu'")) {
...to
<?php
class CustomMenu extends Extension {
public function CustomMenu($menu = null) {
$menu = Convert::raw2sql($menu);
if($menu) {
if(DataObject::get_one('CustomMenuHolder',"Slug = '$menu'")) {
...I'm sure someone will create a menu slug like "John's Links" at some point.
-
Re: New Module: Custom Menus

24 February 2010 at 11:29pm
Hi Hamish,
Cheers for that, can't believe I didn't think of it, I must have been slacking off!
I have added it to the trunk, what is the issue you are having with tortoise?
Mo
-
Re: New Module: Custom Menus

27 February 2010 at 1:05am
I think the correct URL for the svn checkout is:
http://subversion.assembla.com/svn/ssmodules
or
http://subversion.assembla.com/svn/ssmodules/custommenu
I will test your module now because this is exactly what i need ;-) Thanks for this nice little module!
-
Re: New Module: Custom Menus

27 February 2010 at 3:39am
Hi Mo.
I'm trying to use your module right now but I'm getting a javascript error saying $("Form_EditForm") is null on line 207 of LeftAndMain.js when I try to click on a newly created menu. This error also appears when loading the Menus area in SideTabs.js on line 64. I'm trying to run the module on version 2.3.5, is this 2.4 only?
-
Re: New Module: Custom Menus

27 February 2010 at 4:31am Last edited: 27 February 2010 5:40am
Yes, i can confirm this bug. You can workaround it if you call admin page with params like: /admin/menus/show/1
But this doesn't solve the problem itself.I am really new to ss but i think there might have changed something in EditForm(). EditForm() returns if there is no result and it won't call getEditForm() in CustomMenuAdmin.
But there's another issue. It pops up if you click the pages dropdown.
404//I can't handle sub-URLs of a CustomMenuAdmin object. prototype.js?m=1226464322 Line 658
Another one:
There is missing a ?> at the end of _config.php
-
Re: New Module: Custom Menus

1 March 2010 at 12:06pm Last edited: 1 March 2010 12:08pm
Hi Smurkas,
Are you using the Zip file or an SVN Checkout from the trunk?
Cake, what version of SS are you running on?
Cheers for everyone's help on this so far, I am looking forward to making this module as usefall as it can be
.
Mo
-
Re: New Module: Custom Menus

1 March 2010 at 9:17pm
I did an SVN checkout. Should I use the zip file instead?
| 6169 Views | ||
| Go to Top | Next > |




