Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Navigation menu
#1
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
Reply
#2
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.
Reply
#3
Thanks for the reply.

I already tried this but this totally breaks the navigation Sad ... 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
Reply
#4
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.
Reply
#5
Thanks Timbow,

I think I understood what I have to do ... will try your suggestion.

Regards,
Romain
Reply
#6
(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.
Reply
#7
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
Reply
#8
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
Reply
#9
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
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#10
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
Reply
#11
You mean aside from the plugin filter ?

already scheduled for 3.3
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#12
Great !

Thanks for the feedback.

Romain
Reply




Users browsing this thread: 4 Guest(s)