Posts: 2
Threads: 1
Joined: Dec 2010
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
Posts: 1,848
Threads: 86
Joined: Aug 2009
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>
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 2
Threads: 1
Joined: Dec 2010
Thanks for the tip
How can I create a link as a sub-menu item ?
Thanks !
Posts: 972
Threads: 27
Joined: Aug 2009
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.
Posts: 2
Threads: 0
Joined: Jan 2011
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.
Posts: 290
Threads: 26
Joined: Oct 2010
2011-01-11, 06:16:37
(This post was last modified: 2011-01-11, 06:16:59 by Chastin3.)
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>
Posts: 2
Threads: 0
Joined: Nov 2011
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
Posts: 2,094
Threads: 54
Joined: Jan 2011
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".
Posts: 2
Threads: 0
Joined: Nov 2011