Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6769729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:13:41+00:00 2026-05-26T15:13:41+00:00

I am using the simple navigation gem to create some simple navigation for my

  • 0

I am using the simple navigation gem to create some “simple” navigation for my website.

I already have created a tabbed menu with CSS, JQUERY & HTML.

The only problem is creating the exact same CSS and HTML with simple navigation.

Here is my HTML that I am trying to create with simple navigation:

<ul id="ulmenu">

<li class="topmenuli" id="menufirst">
<a href="#" class="">Frontpage<span id="frontpage"></span></a>
<ul id="submenu" style="display: none;">
  <li><a style="font-weight:bolder;text-decoration:underline;background:url(../images/menua.png) no-repeat center bottom;" href="#" class="">Submenu 1</a></li>
   <li><a href="#" class="">Submenu 2</a></li>
</ul>
</li>
<li class="topmenuli">
<span style="display:block;" id="pets"></span>
<a href="#">Pets</a>
<ul style="display:none;" id="submenu">
  <li><a href="#">Submenu 1</a></li>
  <li>Submenu 2</li>
</ul>
</li>
</ul>

My simple navigation config file:

SimpleNavigation::Configuration.run do |navigation|

    primary.item :frontpage, 'frontpage', root_url, :id => 'menufirst', :class => 'topmenuli'
    primary.item :domain, 'Pets', domain_path do |sub_nav|
      # Add an item to the sub navigation (same params again)
      sub_nav.item :dogs, 'Dogs', dogs_path
    end
  end

The output:

<ul><li id="menufirst" class="topmenuli selected simple-navigation-active-leaf"><a class="selected" href="http://localhost:3000/"><span>Frontpage</span></a></li>
<li id="petes"><a href="/pets"><span>Pets</span></a></li></ul>

Not quite as my HTML. The submenus are not showed. I also tried to use highligt but then the breadcrumb navigation is totally wrong.

How do I create my HTML menu with simple navigation?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:13:42+00:00Added an answer on May 26, 2026 at 3:13 pm

    to change attributes on your <ul> container, use (for example) :

    primary.item :domain, 'Pets', domain_path do |sub_nav|
      sub_nav.dom_id = 'some_submenu_id'
      sub_nav.dom_class = 'some_submenu_class'
      sub_nav.item :dogs, 'Dogs', dogs_path
      # add any more items you want
    end    
    

    to change attributes on your <li> elements :

    primary.item :domain, 'Pets', domain_path, :class => 'my_class', :id => 'my_id' # etc.
    

    it is also possible to provide a custom id attribute generator (as stated in the documentation ):

    navigation.id_generator = Proc.new {|key| "my-prefix-#{key}"}
    

    as to your style attributes, i don’t know if simple_navigation handles this, but all you have to do is to create some minimal css selectors:

    .block
    {
      display: block;
    }
    
    .container
    {
      margin: 1em;
    }
    

    … and associated classes :

    <div class="block container">I will be displayed as a block and have a 1em margin</div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an HTML page which uses simple CSS (no javascript) for menu
I'm trying to create a simple image navigation for my site, using CSS to
Created a very simple HTML/CSS drop down navigation using nested unordered lists. Works great
I am trying to create a simple menu using li elements, but it only
I made a website using AJAX (with jquery) for the navigation. The pages of
I'm trying to create a simple table navigation screen in WPF using the entity
If you are building a simple website using just simple HTML/CSS/Javascript that has say
I have annoying problems using django-sitetree (version 0.5.1) for generating a navigation menu with
i have a site with a simple PHP-Navigation (using $_GET-Variables). HTML-code for navigation links
I have a simple navigation menu with plain html links that target different pages.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.