I've been struggling with this for a couple of days now and can't think anymore.
I've created a template for a particular page for event menus and within that page I have a sub menu. This sub menu has event menus. For the purposes of example: Item 1, Item 2 and Item 3
These menu items are their own pages.
The submenu should open the pages in this template. Page layout example below:
Header
Main Nav
Banner Image
Content for Events
Event Menus (Item 1 | Item 2 | Item 3)
Menu Content
Footer
Menu Content switches out by clicking on the menu items, but the Content for Events stays static.
I currently have it working by adding a $_GET variable to the end of the links, but I've hard coded the menu. I don't want this because then the client can't make their own menu changes and edit their menus. (The amount of changes so far has been ridiculous.)
I've put the Event Menus and Menu Content into another nested loop, theoretically so it reacts inside the loop, though initial tests with this have failed.
I'd really like to keep the dynamic nature of Wordpress' menu system, but can't get this to work without hard coding.
At this point I'd be happy with direction on where to research.
Thanks.
If your HTML for the menu content is not too unwieldy, you could potentially drop each menu into a Wordpress Page, where the client could edit it. Simply create a Wordpress page for each menu, drop in your menu content, save it, and make a note of the Page's ID number.
Then, in your template, you can pull in the menu content by getting the Page with something like this:
<?php
// Menu One is content in Page ID # 14
$menu_one = get_post(14);
echo apply_filters('the_content', $menu_one->post_content);
?>
For your reference, get_post on Wordpress Codex: http://codex.wordpress.org/Function_Reference/get_post
On your actual page, what you could do instead of using a GET to grab each menu, is just go ahead and load all 3 menus on page load. Using CSS, you can hide the two you don't want at first and just show the default one. Then using some JavaScript events on the menu item links, you can show the clicked-on menu and hide the other two.
I've put a few notches in my oop and WP programming since asking this question. I think the better way to do this is a custom post type and change the wp_query object with parameters based on the link which can probably just be controlled by post ID. But it would still allow for a menu to be added to the "archive" page that controls the posts. Ultimately allowing client control of the menu, but still having a dynamic ability.
Related
i am working with Joomla 2.5 and K2, in a template i bought.
1st.
i got a an accordion module that display several items into the main page, when i click on any of its elements it redirects me to: http://uxmalrecordscom.ipower.com/index.php/component/k2/item/452-the-dream-master which is correct. (.../index.php/component/k2/item/...)
2nd.
I set this same module to appear into another page called Discography, and when i click in any of the accordion elements it sends me to: http://uxmalrecordscom.ipower.com/index.php/discography/item/452-the-dream-master this URL is different than the first one and is causing me issues to display the content of the Item. (.../index.php/discography/item/...)
My querstion is how can i change the URL for the second case the "Read more" links to avoid display the content of the item in the same page or main menu seccion? or how to make the 2nd to have this kind of URL (.../index.php/component/k2/item/...) instad of (.../index.php/discography/item/...)
Note: Its the same module used on 2 different pages.
Thanks!
The way to solve this is to create a new Main Menu item called "Digital" then select as menu type = "K2 categories" and select the "Digital" category, this will cause all the K2 items listed under "Digital" displays on a different URL so now the url is (.../index.php/digital/item/...) instad of (.../index.php/discography/item/...) and is working awesome!
Hope this can help someone, this solved the problem to me.
I have 3 menus named main menu, microsite menu, supernav menu.
I am creating a view page and wanted to include microsite menu. but the view page is taking the default main menu, how can i remove the main menu and embed the microsite menu.
I cant see any option like selecting the available menus in a view page settings.
How can i achieve this?
Is there any option to embed the microsite menu using php?
a menu was creation, and build as block .. thats true?
if yes .. go to block --> find a microsite menu block --> configuration ---> Show block on specific pages ---> select option tow (Only the listed pages) --> set in text area page view name ..
and go to main menu block --> do same last steps exeption select choice one ( All pages except those listed ) and set page view name too
also you can use a Context module its very very nice for do this action Go here
its can be set any condition, place, rule, pages, for any block ...
by php code you can use a code like this in block configare
if(arg(0) == 'page1') {
return TRUE;
}
I am trying to make a page specific menu in Wordpress, where each page has its own options... The link is http://dev.activenation.co.uk/leisure-centre/southampton-water-activities-centre/
As you go through the "Your Centre" pages, the grey menu changes. At the moment, we are using conditional if statements to load the specific menus, however, the client will need to add more leisure centres.
Was just wondering if there was a more time saving way of doing page specific menus, instead of coding conditional if statements?
Add a custom meta box to the 'page' content type that is a simple <SELECT> list of all of the custom WordPress menus. On save, pull the selected menu ID from the SELECT list and save it to the database. On the page template, check if the saved value exists and if it does, pull in the WordPress menu that has the saved ID.
This will allow an editor to create any number of menus, pick a specific one for each page, and share like menus between pages.
There are a lot of tutorials and code snippets around creating custom meta boxes, and displaying a simple select of the available menus. If you haven't done custom meta boxes before, this is a good intro project since it only has one form field and it's easy to validate the data.
Smashing Magazine has a great walk through on custom meta boxes: http://wp.smashingmagazine.com/2011/10/04/create-custom-post-meta-boxes-wordpress/
If those Centres are subpages of "Your Centre" you could try to use this plugin which creates hierarchical pages / category / taxonomy lists.
I would like to create a nav menu that displays all the pages of a wordpress site, its layout similar to what you would see in a footer sitemap layout, approx 5 columns with all the pages shown. Each page will be a project. I want to use wordpress category checkboxes (like you have for posts) to allow selection of one relevant category for each project page. Each page will then show a category caption below the project's description text, this I will style with CSS so each category has a different background colour.
Because Wordpress doesn't provide categories for pages, I have found a plugin to add this category feature to pages called ninja-page-categories-and-tags: http://wordpress.org/extend/plugins/ninja-page-categories-and-tags/
It's possible to edit the plugin php code under basic-functions.php to return a 'class' for the category displayed using get_slug and then applying css for each.
My problem is that on the menu, which will be a secondary menu in Thirty Ten displaying the pages, I want to be able to colour the background of each link to match the category that has previously been assigned to each page using the ninja plugin. Because the menu works with pages and the categories are not directly linked to the menu items (firebug will not show category details in the html of each link to reference with the css) I am wondering how I can colour each link based on category? Any ideas?
Ultimately what I would like to achieve is a grid of page links that are all coloured based on their category, a colour coded menu.
The plugin uses the standard wordpress category functionality but I just can't think how to connect these category details to the menu items to allow me to style them with css, any help would be really appreciated, even if just a point in the right direction.
Thanks
It's difficult to understand exactly what you're after, but essentially if you want to add extra classes to menu items (which will allow styling), you need to create a custom walker function.
Have a look at a tutorial like this: http://wp.tutsplus.com/tutorials/creative-coding/understanding-the-walker-class/
I am trying to make a simple drop down menu system for my Joomla site. But Joomla menu is completely confusing me. How does a joomla menu work?
For eg: In the image below the whole blue bar is a menu? or each item like 'Projects' is a menu?
Now I can make two pages for Project 1 & Project 2 but where will the 'Projects' link point to? If it does point somewhere then incase of no JavaScript I'd like to point it to a page that shows a list of the menu items.
How do I place my menu at this place in my template?
Why is there a default MainMenu and why do I need to use a menu to show the main content on my site. Shouldn't menus be used for making menus. And I only needed a menu item to show my content not that whole Main Menu. The main confusion is the Main Menu.
I don't wanna use a module coz I couldn't find a good one for 1.7 that uses jQuery (All JavaScript on my site is done with jQuery) and I read somewhere it can be made within the template.
All I want is to somehow place menu items lists inside the respective anchors up top so I can just show/hide them as dropdowns with jQuery.
I hope I haven't made the question confusing pointing to what I need to make. It's just that I'm super confused myself.
Please help.
I appreciate the help.
Thanks Alot.
Joomla menus are generated thru modules. In most cases mod_mainmenu. Theese modules you place in module positions. If your menue should be horizontal on top, then you put your mod_mainmenu module in the position "top". Be aware that every template uses different position names.