Posts: 35
Threads: 8
Joined: Jan 2011
2011-12-18, 20:59:26
(This post was last modified: 2011-12-18, 21:00:14 by rmccawl.)
Plugin Description:
This plugin allows you to make link menus, simply by checking a checkbox, and adding an url in the page edit area!
How to use:
Create a new page, name it whatever you want, check the add to menu checkbox, give a menu name, and check the Link Menu checkbox, and enter the destination url, hit save and enjoy!
Install Instructions:
Put LinkMenus.php into your plugins folder, and put the theme_functions.php into admin/inc/ That's it!
If you have any questions feel free to ask!
Posts: 1,108
Threads: 70
Joined: Aug 2009
what exactly is the change to theme_functions.php
don't like the idea of overwriting core files for a plugin....
Posts: 35
Threads: 8
Joined: Jan 2011
2011-12-19, 03:13:41
(This post was last modified: 2011-12-19, 03:15:38 by rmccawl.)
n00dles101 Wrote:what exactly is the change to theme_functions.php
don't like the idea of overwriting core files for a plugin....
I just edited the get_navigation() function!
The changes are:
after line 632:
Code:
$pagesArray[$count]['linkmenu'] = $data->linkmenu;
$pagesArray[$count]['linkmenuurl'] = $data->linkmenuurl;
and later down:
Code:
if ($page['menuStatus'] == 'Y') {
if($page['linkmenu'] == "yes"){
$menu .= '<li class="'. $classes .'"><a href="'. $page['linkmenuurl'] . '" title="'. strip_quotes($page['title']) .'">'.$page['menu'].'</a></li>'."\n";
}else{
if ("$currentpage" == "$url_nav") { $classes = "current ". $page['parent'] ." ". $url_nav; } else { $classes = trim($page['parent'] ." ". $url_nav); }
if ($page['menu'] == '') { $page['menu'] = $page['title']; }
if ($page['title'] == '') { $page['title'] = $page['menu']; }
$menu .= '<li class="'. $classes .'"><a href="'. find_url($page['url'],$page['parent']) . '" title="'. strip_quotes($page['title']) .'">'.$page['menu'].'</a></li>'."\n";
}
}
where i check if the menu is a link menu and if it is then create a simple link to the url given!
Btw, i dont like editing core files either, but this was made for personal use, then i relased it if somebody needs it!
Would be nice if there is a link menu check box in GS!
Posts: 1,108
Threads: 70
Joined: Aug 2009
why didn't you copy the function, rebame it, make your changes and include it you plugin.
that way there is no need to change core files
Posts: 35
Threads: 8
Joined: Jan 2011
n00dles101 Wrote:why didn't you copy the function, rebame it, make your changes and include it you plugin.
that way there is no need to change core files
Didn't thinked about that... good idea, thanks, will do it in the next version!
Posts: 11
Threads: 0
Joined: Jan 2013
please i want to know how to integrate this plugin with i18n_navigation , anyone can help please!
Posts: 1,204
Threads: 30
Joined: Jun 2010
Why don't you use i18n custom fields do add external links to menu ?
Addons: blue business theme, Online Visitors, Notepad
Posts: 1
Threads: 0
Joined: Feb 2013
Hello, I downloaded your plugin and when I tried to activate it I got
Quote:Fatal error: Cannot redeclare get_page_content() (previously declared in /homez.344/entente/www/admin/inc/theme_functions.php:25) in /homez.344/entente/www/plugins/theme_functions.php on line 31
Now I can't acess anything, nor the site or the admin page !