- This topic has 2 replies, 2 voices, and was last updated 15 years, 10 months ago by imported_Ryan.
-
AuthorPosts
-
January 21, 2009 at 12:00 am #557brandnewaquariumMember
I want to add Multi-level Menus to a template for several sites; however, I’m not sure how this will affect other sites with the same template which do not currently have it activated? I tried using WP Menu Creator, and it made it so that the page would not render if I installed the plugin and activated it on one site, but hadn’t gotten to activating it on other sites?
I see that there’s a conditional in the actual implementation statement; I trust that this will allow it to downgrade gracefully?
January 21, 2009 at 12:22 am #4813imported_RyanMemberHi,
Yes, with the conditional in place, the menu will simply dissapear if the plugin isn’t installed.An alternative method would be to use the same technique used in the PixoPoint Template Generator[/url:2x5hvawi]. When the plugin is installed, the menu uses the plugin to display the menu items and a prompt appears in the plugin page asking if you want to use the themes built in CSS, or the CSS entered into the plugin page. When the plugin is disabled, the menu is still there, but is simply displayed as a regular list of WordPress pages and always uses the themes built in CSS.
You can see a demo of this in the Aqua Vaccinium theme. If you visit the following URL you will see the regular menu:
https://geek.hellyer.kiwi/?generator=preview_aquavaccinium
However, if you activate the plugin via the following URL, you will see that the plugin is controlling the menu content. It changes from a regular ‘pages only’ menu into a more complicated one with extra features including the dropdown arrows and hover animations.
https://geek.hellyer.kiwi/?mln=onJanuary 21, 2009 at 12:29 am #4814imported_RyanMemberHere is the code used in the themes from the template generator:
[code:1d252dhd]<?php
if (function_exists(‘pixopoint_menu’) && function_exists(‘pixopoint_mainmenu’)) {echo ‘<div class="mainmenu1"><div class="mainmenu2"><div class="mainmenu3">’;pixopoint_menu();echo ‘</div></div></div>’;}
elseif (function_exists(‘pixopoint_mainmenu’)) {pixopoint_mainmenu();}
?>[/code:1d252dhd]If the plugin function pixopoint_menu is found, then the plugin is displayed. If it isn’t, then the function pixopoint_mainmenu() is displayed instead.
The plugin detects the function pixopoint_mainmenu(). If it finds it, then that is when it prompts to ask if you want to use the built in theme styling of the menu or to use whatever is entered directly into the CSS box of the plugin.
If you have any questions about any of this, please don’t hesitate to ask. I am extremely keen to encourage theme authors to implement the plugin into their designs and am more than happy to offer as much help as is necesary (I’ll even do it for you if needed).
EDIT: Note, for this to work, you would need to use a different ID/class for the built in menu. So the function pixopoint_mainmenu() could look something like the following:
[code:1d252dhd]<?php
pixopoint_mainmenu() {
echo ‘<ul id="suckerfishnav_themecss">’;
<?php wp_list_pages(); ?>
echo ‘</ul>’;
?>[/code:1d252dhd] -
AuthorPosts
- You must be logged in to reply to this topic.