Get record ID in _headerModuleList.tpl (CE)

I'm trying to customize the very top navigation menu and figured out everything except for how to get the module name and record ID inside _headerModuleList.tpl (template which generates the top navigation bar)

What I tried:

- Calling $_REQUEST inside .tpl file, but since the URL contains a # it seems like the module name, record etc. are generated by JS

- Calling $bean->id, $focus->id etc.

- Setting up a custom view then defining module/record id as a smarty variable > defining a custom header in metadata for that view > reading that smarty variable inside the custom header. Problem is that it seems like we can only specify a custom 'headerTpl', but not a custom 'headerModuleList.tpl'

- Tried all relevant smarty loops inside "_headerModuleList.tpl"


May be a powerhouse like Francesca Shiekh , drifterjack drifterjack, Ara Gon would be kind enough to share their experience with this

There's surprisingly very little documentation on this except for standard modifications via admin interface

Parents Reply Children
  • Hi Francesca, thank you for the reply and just wanted to say I learned a lot from your other posts!

    I'm using Community Edition 6.5, so unfortunately there's no ./clients/base/layouts/header/header.php

    I'm trying to customize the top header based on the department chosen by the user. So after the user clicks on department X the system will set a cookie and keep showing a custom header related to that department until the visitor chooses a different department.

    I can set and read the cookie in _headerModuleList.tpl when the user clicks on a specific department, the problem is tricky because on the department detail view I set the cookie further down the code, so on the department detail view page itself the Nav Menu will not be customized.. 

    Hope it's not too confusing. So If I could read the module name + record ID in headerModuleList I could customize the Nav Bar right away without waiting to set the cookie.