Title of article with multiple pages - Joomla! Forum - community, help and support
hello, have created article multiple pages. when insert new page asked insert title , alt text new page.
when view page front end article title , page title. there way how can show article title , show page title somewhere else on page??
when view page front end article title , page title. there way how can show article title , show page title somewhere else on page??
sim085 wrote:is there way how can show article title , show page title somewhere else on page??
the way managed achieve follows:
1) split title $this->item->title symbol ' - ' $article_title, , $page_title.
2) update $this->item->text $page_title (where wanted).
3) print $article_title instead of $this->item->title.
the code follows:
code: select all
// split article title page title.
$pos = strpos($article_title, "-", 0);
$page_title = substr($article_title, $pos + 1);
$article_title = substr($article_title, 0, $pos - 1);
// getting position page title inserted.
$pos = strpos($this->item->text, "pagenavcounter", 0);
$pos = strpos($this->item->text, "div", $pos);
$pos = $pos + strlen("</div>");
// insert page title in $this->item->text
$replace = substr($this->item->text, 0, $pos);
$with = $replace."<div class=\"page_title\">".$page_title."</div>";
$this->item->text = str_replace($replace, $with, $this->item->text);
i consider hack , - although works fine - still better standard solution not obvious me @ moment...
is there maybe documentation on subject?
Comments
Post a Comment