Title for Categories and Tags page

Discuss PivotX 2.0.x here. Non-PivotX related discussions go in The Drain.

Title for Categories and Tags page

Postby loly » Fri Aug 15, 2008 4:18 pm

Add to module_parser.php
Code: Select all
function renderWeblog() {
if (!empty($this->modifier['category'])) {
$cats = $PIVOTX['categories']->getCategory($this->modifier['category']);
$PIVOTX['template']->assign('title', __($cats[display]));

now you categories page have title(use [[title]] tag)
add to function renderTag()
Code: Select all
$PIVOTX['template']->assign('title', __($this->modifier['uri']));

add you tag`s page have title.
Maybe not perfect, but work for me ....
Posts: 64
Joined: Mon Mar 31, 2008 7:59 am
Location: Russia

Re: Title for Categories and Tags page

Postby hansfn » Tue Aug 26, 2008 12:54 pm

Thx for coming with ideas, loly. This is basically what my livetitle snippet did for Pivot. I'll add something similar to the core when I get the time for it.

However, two things needs to be said:
1) The change to renderTag makes your site vulnerable to XSS.
2) In general assigning something to 'foo' makes it available as [[$foo]] in the template. 'title' just worked by accident.
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Return to 2.x Discussion

Who is online

Users browsing this forum: No registered users and 1 guest