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 4027490
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:06:10+00:00 2026-05-20T11:06:10+00:00

I have the following (simplified) layout: <header> … more stuff here <nav id=nav> <div

  • 0

I have the following (simplified) layout:

<header>
  ... more stuff here
  <nav id="nav">
    <div class="content_wrapper">
      <ul id="menu">
        <li>dashboard</li>
      </ul>
    </div>
  </nav>
</header>
<div id="main_content">
  <div class="content_wrapper">
    <g:layoutBody/>
  </div>
</div>

My problem is that the “menu” nav is dependent on what is rendered in the layoutBody. Not only will the text “dashboard” change to “login”, “support”, etc but on some pages there are buttons, links, etc. Is there any way in Grails, without changing the layout of the page, to dynamically render this NAV element based on the layoutBody? I’ve read the docs including the content block section, but they don’t solve the problem because they are still pre-determined in the main layout.

  • 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-20T11:06:11+00:00Added an answer on May 20, 2026 at 11:06 am

    I have the same problem on my grails webapp. Here is the way I have solved it.
    In your layout:

    <nav id="nav">
        <div class="content_wrapper">
          <ul id="menu">
            //Here you can insert whatever you have in all your pages
            //Then below you can insert custom content depending on main body
            <li><g:pageProperty name="page.nav-content"/></li>
          </ul>
        </div>
    </nav>
    

    Then in your main views (like home.gsp) requiring additional modules (like login module), you can include something like:

    <content tag="nav-content">
       <g:include controller="nav" action="login"/>
    </content>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the SQLite database and have the following persistent class (simplified): public
I have following situation (simplified, of course): MyDomain.groovy: class MyDomain { MyAnotherDomain anotherDomain //
I have the following layout in my project (quite simplified): Assembles App.WinClient <--- client
I have the following simplified ViewModel public class UserViewModel : IUserViewModel { public DelegateCommand<object>
I have the following model (simplified): abstract class CartItem { EntityReference<Cart> Cart; } class
I have the following situation (simplified): a.h: #include <boost/serialisation/serialisation.hpp> class B; using namespace std;
I have a database where I store objects. I have the following (simplified) schema
I am debugging some code and have encountered the following SQL query (simplified version):
I have the following (simplified) public enum Level { Bronze, Silver, Gold } public
I have the following (simplified) query select P.peopleID, P.peopleName, ED.DataNumber from peopleTable P left

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.