How to add prefix to all article titles in joomla site - Joomla! Forum - community, help and support


hi,

i want automatically add prefix (eg. 'hon.') titles of article in joomla site anywhere article title appears....whether on single article page or frontpage (in blogview) or in search results.....wherever. don't want seo there extensions available append prefix/suffix "page title" not want that.

what want article titles (as in com_content) automatically appended 'hon.' prefix (as add in front of names of judges, presidents etc).

now tried add html in template override folder mytemplate/html/com_content/articles/default.php , in fact components/com_content/views/articles/tmpl/default.php , components/com_content/views/frontpage/tmpl/default.php (just see if works, want in override).

but nothing worked. tried adding html in following way -

<h1 class="pagetitle">
hon. <?php echo $this->escape($this->params->get('page_title')); ?>
</h1>


and tried -

<h1 class="pagetitle">
<?php echo hon. $this->escape($this->params->get('page_title')); ?>
</h1>


and in files mentioned above didn't appear change anything.

can please guide me if either looking @ wrong files or using wrong syntax ?

i have done way in joomla 1.5 can't remember how.

thanks,

sean.

hi

i had quick , far can tell need update file related type of output, e.g. site root/components/com_content/views/article/tmpl/default.php general articles.

if around line 40 should see entries title following:
<?php if ($params->get('show_title')) : ?>
<h1>
<?php if ($params->get('link_titles') && !empty($this->item->readmore_link)) : ?>
<a href="<?php echo $this->item->readmore_link; ?>">
hon.<?php echo $this->escape($this->item->title); ?></a>
<?php else : ?>
hon.<?php echo $this->escape($this->item->title); ?>
<?php endif; ?>
</h1>
<?php endif; ?>

just add hon. did above , should after.

you may need update other files, e.g. leading articles etc.





Comments