Posts: 29
Threads: 5
Joined: May 2012
Hi,
I downloaded a HTML5 theme and would like to integrate GetSimple CMS.
However, I'm stuck with the navigation.
In the original HTML5 theme, navigation is build using following code :
<nav id="nav">
<a href="index.html" class="current-page-item">Homepage</a>
<a href="twocolumn1.html">Two Column #1</a>
<a href="twocolumn2.html">Two Column #2</a>
<a href="onecolumn.html">One Column</a>
<a href="threecolumn.html">Three Column</a>
</nav>
How can I integrate this into GetSimple ?
Many thanks for your help,
Romain
Posts: 1,127
Threads: 136
Joined: Feb 2012
Normally you would write the nav like this:
Code:
<nav id="nav">
<ul>
<?php get_navigation(return_page_slug()); ?>
</ul>
</nav>
You cannot in a GetSimple theme template specify what pages are actually included in the site.
It is very normal to code the nav as an unordered list ( <ul> ), I don't know why your page just has a series of <a> elements not in a list, but in GetSimple it has to be a list, so use the <ul> tags.
Posts: 29
Threads: 5
Joined: May 2012
Thanks for the reply.
I already tried this but this totally breaks the navigation
... seems that I need to make major CSS modifications.
Is there a way in GetSimple to get a list of all pages and manually build the navigation as required by this theme ?
Romain
Posts: 1,127
Threads: 136
Joined: Feb 2012
I can't know what you are trying to do, but it doesn't look difficult. I would guess that where your css has styling for the menu it will be nav a {declaration; declaration;} and for GetSimple you would need to make it nav li {declaration; declaration; } but I could be wrong.
for the different pages: in GetSimple you can define different page layouts (two column, three column) as different page templates in your theme, so you will make several template files (template.php (the default), onecolumn.php , threecolumn.php). When the theme is activated the menu is built as you create pages and assign a page template to each new page.
it is easier to do than explain.
Posts: 29
Threads: 5
Joined: May 2012
Thanks Timbow,
I think I understood what I have to do ... will try your suggestion.
Regards,
Romain
Posts: 1,127
Threads: 136
Joined: Feb 2012
(2013-08-16, 08:10:13)rpetges Wrote: Thanks Timbow,
I think I understood what I have to do ... will try your suggestion.
Regards,
Romain
Careful. I may have told you something wrong: Styling a nav menu as a list - I think you apply styles to the <a> element rather than the <li> element. Can't remember why.
Posts: 29
Threads: 5
Joined: May 2012
I replaced the complete <a> navigation by an unordered list ... it works great.
However, I have another question: In the navigation menu, I would like to put a menu entry that points to an index page for a forum.
For example,
http://mydomain.com/forum should be linked to the Forum navigation menu entry. Any idea on how to accomplish that ?
Thank you for your support.
Romain
Posts: 1,127
Threads: 136
Joined: Feb 2012
2013-08-16, 23:10:26
(This post was last modified: 2013-08-17, 00:04:37 by Timbow.)
An easy way to add an external link is to add it to the end of the nav <ul> like this:
Code:
<nav id="nav">
<ul>
<?php get_navigation(return_page_slug()); ?>
<li><a href="http://nedomain.com/forum" title="External link to Forum">Forum</a></li>
</ul>
</nav>
More than that requires a plugin. I think the i18n plugin allows you to add links to your menu but i have never used it.
PS Carlos' redirect plugin, new today will let you add a menu entry, see
http://get-simple.info/forums/showthread.php?tid=5070
Posts: 6,266
Threads: 181
Joined: Sep 2011
The 'menuitems' hook is called at the end of get_navigation.
You could use my hook_components plugin to add these via a component fairly easily.
Edit: nevermind menuitems is a filter, so disregard that
Posts: 29
Threads: 5
Joined: May 2012
Thanks for the suggestions.
@shawn_a : Maybe it would be a good idea to include navigation functionality to external or internal links in the core for future versions.
Regards,
Romain
Posts: 6,266
Threads: 181
Joined: Sep 2011
You mean aside from the plugin filter ?
already scheduled for 3.3
Posts: 29
Threads: 5
Joined: May 2012
Great !
Thanks for the feedback.
Romain