GetSimple Support Forum
Use Link as Menu item ? - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: Use Link as Menu item ? (/showthread.php?tid=1155)



Use Link as Menu item ? - freekers - 2010-12-01

Hello

How can I use a Link as Menu item ? I can't find this option anywhere. I only have the ability to create a new page, but I don't want that. I want a link e.g. google.com as a menu item. How do I do that ?

Thanks


Use Link as Menu item ? - ccagle8 - 2010-12-01

In your template, do something like this:
Code:
<ul id="nav">
      <?php get_navigation(return_page_slug()); ?>
      <li><a href="http://www.google.com" >Google</a></li>
</ul>



Use Link as Menu item ? - freekers - 2010-12-01

Thanks for the tip Smile

How can I create a link as a sub-menu item ?

Thanks !


Use Link as Menu item ? - Zegnåt - 2010-12-04

freekers Wrote:How can I create a link as a sub-menu item?
This is currently impossible because you can’t change the menu structure from the way it’s generated by get_navigation(). This will be supported through a plugin filter (menuitems) in the next version of GetSimple.


Use Link as Menu item ? - georgewiel - 2011-01-09

I'm surprised that the ability to use an external url as a menu item was overlooked (page management seems to be one of the weak spots in GetSimple). While a template adjustment will work in this case, it is beyond the ability of my clients who are managing the site with the backend UI.

Please add this to your upcoming feature list as well as a drag-able UI for arranging the page order.


Use Link as Menu item ? - RobA - 2011-01-11

I had cobbled together a quick plugin to play with the $menuitems variable. This plugin turns the linst items into an array, then adds entries into the array. Consider it a starting point for anyone who wants to write a "custom menu link" plugin.
Code:
<?php
/*
Plugin Name: Menu Modify
Description: Modifies the Menu
Version: 0.1
Author: Rob Antonishen
Author URI: http://ffaat.pointclark.net
*/

# get correct id for plugin
$thisfile=basename(__FILE__, ".php");

# register plugin
register_plugin(
    $thisfile,
    'Menu Modify',    
    '0.1',        
    'Rob Antonishen',
    'http://ffaat.pointclark.net',
    'Modifies the menu',
    'theme',
    'menu_show'  
);

# activate filter
add_filter('menuitems','menu_filter');


function menu_show() {}

function menu_filter($menuitems) {
  preg_match_all("/<li(.*)?>(.*?)<\/li>/",$menuitems,$menuarray);
  #insert at start
  #array_splice($menuarray[0],0,0,'<li><a href="http://something.com" title="New Menu Item">New Item</a></li>');
  #insert at end
  array_splice($menuarray[0],count($menuarray[0]),0,'<li><a href="http://www.google.com" title="Google">Google</a></li>');
  $menuitems = implode($menuarray[0]);
  return $menuitems;
}
?>

-Rob A>


Use Link as Menu item ? - ajackson - 2011-11-17

Hello,

I think what you are trying to do is not possible because you are not change the menu structure from the way it’s generated by get_navigation().

Good luck


Use Link as Menu item ? - mvlcek - 2011-11-17

ajackson Wrote:I think what you are trying to do is not possible because you are not change the menu structure from the way it’s generated by get_navigation().

See here - "Internal/external Links".


Use Link as Menu item ? - ajackson - 2011-11-25

Thank you very much!