Page 1 of 1

page number in title

Posted: 15 Jul 2012, 20:14
by HiopsNerevar
Hi Jan! I insert page number in the title (Google complained of the same title), but I don't know how to make the code checks if Pagination enabled. Because of this there is a small error is displayed: "sitename - category - " but i need "sitename - category " wthisout a dash at the end of.

My code

Code: Select all

if (isset($category->title) && $category->title != '') {
$title = $title .' - ' .  $category->title .' - ' . $this->tmpl['pagination']->getPagesCounter();
}
Kind regards,
HiopsNerevar

Re: page number in title

Posted: 17 Jul 2012, 21:47
by Jan
components/com_phocagallery/views/category/tmpl/default.php

Re: page number in title

Posted: 18 Jul 2012, 21:25
by HiopsNerevar
Sorrry. I change /components/com_phocagallery/views/category/view.html.php on 2223 line. But I want to code check there pagination on page and if yes output my code or if no output your code.

Exaple:

Code: Select all

if (isset($category->title) && $category->title != '') {
$title = $title .' - ' .  $category->title;	} 
esle if (isset($category->title) && $category->title != '' && THIS CHECK PAGINATION ON PAGE) {
$title = $title .' - ' .  $category->title .' - ' . $this->tmpl['pagination']->getPagesCounter();
} 
:idea:

ps.
http://dragonsun.ru/galereya/category/6-3d-drakony.html page without pagination and "-" on the end
http://dragonsun.ru/galereya/category/9 ... akony.html with pagination

Re: page number in title

Posted: 22 Jul 2012, 17:34
by Jan
Hi, check if the menu link to first category has set it in parameters (if you disable the SEF, you will see Itemid, which is ID of the menu link and they you can test, if such menu link includes pagination feature - if it is enabled)

Jan