Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Show category Title in module.
Page:
1
Show category Title in module.
Re: Show category Title in module.
Is this regarding article categories, or categories of some other component?
If article categories, do you want the name of the category when viewing category blog/list pages, or just when you are on individual article pages?
Cheers,
Stephen
Administrator has disabled public posting
Re: Show category Title in module.
Code:
$title = "";
if ($option == "com_content") {
if ($view == "article") {
$my_id = $db->Quote( $db->getEscaped( (int)$id ) );
$query = "SELECT cat.title "
. " FROM #__categories cat, #__content a WHERE a.catid = cat.id"
. " and a.id = $my_id AND a.state = 1";
$db->setQuery( $query, 0, 1 );
$row = $db->loadObject();
if ($row != null) $title = $row->title;
}
if ($view == "category") {
$my_id = $db->Quote( $db->getEscaped( (int)$id ) );
$query = "SELECT cat.title "
. " FROM #__categories cat WHERE "
. " cat.id = $my_id";
$db->setQuery( $query, 0, 1 );
$row = $db->loadObject();
if ($row != null) $title = $row->title;
}
}
if ($title != "") echo "<h3>$title</h3>";
/* (or whatever you want to do with the title) */
This does both category list pages, and individual articles.
Hope that helps,
Stephen
Administrator has disabled public posting
Page:
1
- Index
- » MetaMod
- » MetaMod General Support
- » Show category Title in module.
Board Info
- Board Stats:
- Total Topics:
- 1689
- Total Polls:
- 6
- Total Posts:
- 5942
- Posts this week:
- 2
- User Info:
- Total Users:
- 7627
- Newest User:
- rudys68879
- Members Online:
- 0
- Guests Online:
- 181
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked