GetSimple Support Forum
Custom Menu (Version 0.6) - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Plugins (http://get-simple.info/forums/forumdisplay.php?fid=13)
+--- Thread: Custom Menu (Version 0.6) (/showthread.php?tid=5094)

Pages: 1 2


Custom Menu (Version 0.6) - Angryboy - 2013-08-22

At the time of publishing, there hasn't being a plugin that lets you build menus independently of pages (i.e. entries have to be added into the template file manually). This plugin seeks to try and solve that issue.

Download (latest)
https://github.com/lokothodida/gs_custom_menu/archive/master.zip

Github
https://github.com/lokothodida/gs_custom_menu/

Features
  • Build nested/hierarchical structures (as you could with the built-in GetSimple navigation)
  • Add any URLs to the list, external or internal, regardless of whether the page exists (e.g. dummy pages, dynamically generated pages, etc...)
  • Create any number of menus desired, for any required purpose
  • Dead-simple to make an item open its link externally
  • Has placeholder (% custom_menu 'menuname' %) to allow function to be called in page content also
  • Menus are generated entirely independent of existing built-in menu navigation - they will not affect that original menu
  • Images can be used instead of text (v0.5+)
  • Available in English, Italian, Russian and German (Google Translations)
Usage
https://github.com/lokothodida/gs_custom_menu/wiki/Usage

Screenshots
[Image: 28de9664-0aa5-11e3-9fa8-07a24670d501.png]
[Image: 28e41314-0aa5-11e3-89e8-d477777e1ac8.png]
[Image: 28e06912-0aa5-11e3-9853-e66900b8e346.png]

Changelog


RE: Custom Menu - Oleg06 - 2013-08-22

transliteration of the link does not work


RE: Custom Menu - Angryboy - 2013-08-22

Changelog (v0.2)
- Transliteration added (for page title, slug and url).


RE: Custom Menu (Version 0.2) - Oleg06 - 2013-08-22

why Tittle transliteration? Smile


RE: Custom Menu (Version 0.2) - Angryboy - 2013-08-22

I thought that normal page titles had that done as well (from looking in the admin/changedata.php code). Should that be removed for titles?


RE: Custom Menu (Version 0.2) - Oleg06 - 2013-08-22

Is menu should not be in Russian? http://i1.minus.com/ibfwhca59B3QuM.jpg


RE: Custom Menu (Version 0.2) - Angryboy - 2013-08-22

Changelog (v0.3)
- Transliteration no longer affects menu titles/labels
- HTML base tag added to fix relative urls (now all are relative to site url)


RE: Custom Menu (Version 0.3) - ohayo - 2013-08-22

I'm having problem enabling Custom Menu:

Warning: Invalid argument supplied for foreach() in /home/xtz/domains/test.xyz.com/public_html/plugins/custom_menu/php/class.php on line 243

GS 3.2.2, debug mode not showing anything.


RE: Custom Menu (Version 0.3) - Angryboy - 2013-08-23

Does the file data/other/custom_menu/default.xml exist? (It should be created automatically when you access the Customize Menus page). I don't get the error - even if I delete the custom_menu folder and reload the page.

Nevertheless:

Changelog (v0.31)
- Attempt to fix error ohayo picked up


RE: Custom Menu (Version 0.31) - ohayo - 2013-08-23

I've checked and there was no visible default.xml, but when I was trying to copy newly created I was ask if I wanted to overwrite old default.xml.

Also I couldn't delete folder "custom_menu" so I've check the folder permissions - it was 357 (not sure, definitely 3xx). Setting permissions manually to 755 solved the problem and now I can create new entries.

OK, checked other server - same situation. Default permission is 341, changing to 755 resolves the problem Smile


RE: Custom Menu (Version 0.31) - Angryboy - 2013-08-23

That's good to hear :-)

So are you affirming that this is a problem on your server (with directory/file write permissions)? Or is this the only plugin that you've used that has failed to create directories with the correct permissions?


RE: Custom Menu (Version 0.31) - Oleg06 - 2013-08-23

and I also doing well Smile cool plugin, very useful


RE: Custom Menu (Version 0.31) - ohayo - 2013-08-23

This is the only plugin that failed (I'm using about 10 plugins). I've tested 2 separate servers and problem was still there, don't know why.

Is it possible to mix Custom Menu plugin with Bootstrap dropdown menus (now it's based on I18N menu)? It would be useful for people using #anchors in links as in GS you cannot save link with "#".

Check - http://get-simple.info/forums/showthread.php?tid=3038&page=2
I'm using it here - http://test.parepikseli.com/

Code:
<div class="nav-collapse">
   <ul class="nav">
   <?php get_i18n_navigation(get_page_slug(FALSE),0,1,I18N_SHOW_MENU, 'nav'); ?>
   </ul>
</div>

+ component 'nav'

PHP Code:
<?php
$ismenu 
false;
$caret $dropdown $dropdown_list '';

$classStr $item->classes;
$classes explode(' ',$item->classes);
if(
in_array('current',$classes)) $classStr .= ' active';
if(
in_array('currentpath',$classes)) $classStr .= ' active';

if(
$item->hasChildren and ($item->isOpen or $ismenu==true)){
  if(
in_array('open',$classes)) $classStr .= ' dropdown';
  
$dropdown 'data-toggle="dropdown" class="dropdown-toggle"';
  
$dropdown_list ' class="dropdown-menu"';
  
$caret '<b class="caret"></b>';
  
$classStr str_replace('open','',$classStr);
}

?>
<li class="<?php echo $classStr?>">
  <a href="<?php echo htmlspecialchars($item->link) . "\""; echo ' '.$dropdown?> >
    <?php 
      
# debugLog(htmlspecialchars($item->text));           
      
echo htmlspecialchars($item->text); echo $caret
    ?>
  </a>
  <?php if ($item->isOpen) { ?>
    <ul<?php echo $dropdown_list.'>'$item->outputChildren(); ?></ul>
  <?php ?>
</li> 



RE: Custom Menu (Version 0.31) - Oleg06 - 2013-08-23

can come up with a class currentpath? Smile
and mysite/ssylka1/ssylka2/ssylka3/


RE: Custom Menu (Version 0.31) - Angryboy - 2013-08-24

Changelog (v0.4)
- Classes for current path, current item, parents (equivalent of hasChildren) and children (terminating items) added
- Main PHP Function now has $classes parameter for you to set your own names for the classes above:
PHP Code:
<?php get_custom_menu($menu$classes=array('currentpath' => 'newcurrentpath', ...));  ?>
-- The array's keys correspond to the class names. The values correspond to the new values that they will take.
-- Available keys: currentpath, current, parent, child


RE: Custom Menu (Version 0.31) - evan70 - 2013-08-24

I had permission problem too, but after change folder perms > 755 everything work like charm Wink Great job again ! Many ThX AB Wink


RE: Custom Menu (Version 0.4) - Oleg06 - 2013-08-25

is it possible to make so that when you create a new page is added menu item? but to leave the ability to add individual menu items.


RE: Custom Menu (Version 0.4) - Angryboy - 2013-08-25

It's very unlikely. The menus created are designed to exist independently of all other data structures. I can't think of a way to work that feature in successfully. Sad


RE: Custom Menu (Version 0.4) - Oleg06 - 2013-08-25

yes, I forgot, the plugin is very useful and cool Smile


RE: Custom Menu (Version 0.4) - davetest - 2013-08-25

I tried instal of v0.4 in both gs3.1.2 and gs3.2.3. I had permissions prob in both with custom_menu data directory being created with perms of 1321. I changed it to 0755 and now works ok in gs3.2.3 but in gs3.1.2 it only part works, with the '+ Item' button not working, so can't add a second menu item :-(

Guess I'll stick with the latest stable GS :-)


RE: Custom Menu (Version 0.4) - datiswous - 2013-09-09

Hey, very nice plugin!

What you could ad:
  • drop down menu for slug-selection
  • add image instead or with link

Some websites use images as links in a menu.


RE: Custom Menu (Version 0.4) - Everyone - 2013-09-09

Just discovered this... now I'm really angry at myself for using this other CMS (which by now I grown to hate) for a project of mine...

@datiswous: Important navigation menus don't consist of images because such menus aren't SEO friendly.


RE: Custom Menu (Version 0.4) - datiswous - 2013-09-09

(2013-09-09, 19:19:59)Everyone Wrote: @datiswous: Important navigation menus don't consist of images because such menus aren't CEO friendly.

I thought there are ways to make them still seo friendly.


RE: Custom Menu (Version 0.4) - Angryboy - 2013-09-12

Changelog (v0.5)
- Deleted unnecessary create.php file (if you still have this file, you can safely delete it)
- Dropdown menu with list of page slugs added for convenience (@datiswous)
- 'Image' field added - when URL is supplied, image is shown instead of text (@datiswous)
-- Also, if you do not provide a domain prefix (http://...), the image url is made relative to the data/uploads/ folder
- If no URL is provided, no anchors are output around the text/image are output
- Image and anchors have 'title/alt' attributes for better SEO (@Everyone)
- Ensures no two entries can have the same slug (before, this problem could cause infinite recursive loop(s) when displaying the menu)


RE: Custom Menu (Version 0.4) - evan70 - 2013-09-13

Thank You AB !