Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Joomla Body ID Tag Using Menu Item Alias

Avatar of smfmetro10
smfmetro10Flag for United States of America asked on
2 Comments1 Solution908 ViewsLast Modified:

I am trying to create unique body tags for each of my pages in my custom template that I created for Joomla.  In my custom template index.php file, I used the code:
$menu = &JSite::getMenu();
$active = $menu->getActive();
<body id="page_<?php print $active->alias; ?>">

in place of the <body> tag.  

In my Joomla admin panel, I go to Menus -> Menu Manager, and click "Menu Items" in the Main Menu row.  I have two items in there: Home (was in there already)  and Courses.  When I click on "Courses," it goes to the editing screen, and the Alias says "courses."  (and it refers to an article "Courses" in the parameters area.

So theoretically, my body tag should say <body id="page_courses">, but it doesn't.  However, the home page DOES work and says: <body id="page_home">, so I know I'm doing something right.  I just must have a setting wrong for the "courses" menu item/article.

Any suggestions?  Is that enough info to go on?

I'm a Joomla newbie, btw.

Avatar of smfmetro10
smfmetro10Flag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers