Home » Forum
NoNumber!

Joomla! extensions & websites
development / support / consultancy

I try to respond within 24 hours (excluding weekends). If I haven't responded by then, feel free to post a reminder or bug me via email.
Welcome, Guest
Please Login or Register.    Lost Password?

Create Tag to Show Page Title
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Create Tag to Show Page Title
#8733
Create Tag to Show Page Title 4 Months, 2 Weeks ago  
ReReplacer is very slick. I would like to create a tag called [[title]] that would be replaced with the title of the current webpage. Culd you please explain how this would be possible? Thank you in advance.
Brett Bruce
Posts: 2
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#8734
Re: Create Tag to Show Page Title 4 Months, 2 Weeks ago  
You can do this in combination with Sourcerer.
You can make ReReplacer replace your tag with a piece of php code that will be executed by Sourcerer.

For instance:
Search:
[[title]]

Replace:
{source 0}<?php
  $document =& JFactory::getDocument();
  echo $document->title;
?>{/source}}
Peter van Westen
Admin
Posts: 4533
User OfflineClick here to see the profile of this user
Last Edit: 2010/04/23 10:17 By peter.
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
#8744
Re:Create Tag to Show Page Title 4 Months, 2 Weeks ago  
Thank you for the unbelievable fast response. Works great, but it is also showing the site name as well i.e. sitename-pagename. I am using SH404SEF, Is there a way that I can remove the website title from the returned page title. FYI, the page title itself only shows the page title. Thanks again for your help.
Brett Bruce
Posts: 2
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
 
#8758
Re:Create Tag to Show Page Title 4 Months, 2 Weeks ago  
I am not sure at what stage the SEF changs the page title. So it might work if you change the order of the plugins.
But with php you can do anything with the returned info before echoing it. Stuff like this:
{source 0}<?php
  $document =& JFactory::getDocument();
  // get page title
  $title = $document->title;
  // remove website name
  $title = str_replace( 'My Website Name', '', $title );
  // Make it bold
  $title = '<strong>'.$title.'</strong>';
  // etc....
  echo $title;
?>{/source}}
Peter van Westen
Admin
Posts: 4533
User OfflineClick here to see the profile of this user
The administrator has disabled public write access.
Need to contact me directly? Go to my contact page.
If you use any NoNumber! extensions, please post a rating and a review at the Joomla! Extensions Directory.
Are you happy with the support? Please consider buying a License Code to help me to continue development and support.
 
Go to topPage: 1
Joomla Open Source Training