Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom Menu (Version 0.6)
#1
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...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...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
Reply
#2
transliteration of the link does not work
Reply
#3
Changelog (v0.2)
- Transliteration added (for page title, slug and url).
Reply
#4
why Tittle transliteration? Smile
Reply
#5
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?
Reply
#6
Is menu should not be in Russian? http://i1.minus.com/ibfwhca59B3QuM.jpg
Reply
#7
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)
Reply
#8
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.
Reply
#9
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
Reply
#10
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
Reply
#11
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?
Reply
#12
and I also doing well Smile cool plugin, very useful
Reply
#13
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...038&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> 
Reply
#14
can come up with a class currentpath? Smile
and mysite/ssylka1/ssylka2/ssylka3/
Reply
#15
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
Reply
#16
I had permission problem too, but after change folder perms > 755 everything work like charm Wink Great job again ! Many ThX AB Wink
Reply
#17
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.
Reply
#18
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
Reply
#19
yes, I forgot, the plugin is very useful and cool Smile
Reply
#20
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 :-)
Reply
#21
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.
Reply
#22
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.
Reply
#23
(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.
Reply
#24
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)
Reply
#25
Thank You AB !
Reply




Users browsing this thread: 2 Guest(s)