Home Joomla! Joomla! Tutorials How to access only the Component heading/title in a Joomla! 1.5 template?
 
 
 

How to access only the Component heading/title in a Joomla! 1.5 template?

PDF Print E-mail

Question: How to access only the component heading/title in a Joomla! 1.5 template when building a new template and the component heading needs to be in a strategic place on the template? 

Answer:  

Insert the following code where you need to have the component heading displayed on the template.

//Open PHP tag
<?php
          //First we instantiate the document object, to get all document details.
         $document =& JFactory::getDocument();

         //Now we echo the component heading by echoing the getTitle() method of the getDocument class
         echo $document->getTitle();

//Closing PHP tag
?>              

NOTE: This has been tested in Joomla! 1.5.10. I don't think this is the right method to do this, only use this if absolutely neccesary.                 

+/-
  • Hadi N - Get title do not work for me
    Hi, thanks. I use the scripts above, but the result always refers to the Site
    Title, instead of my article title.
    Do you know how it happened, and what is the correct scripts?
  • TechPortal - re: Get title do not work for me
    Hadi N wrote:
    Hi, thanks. I use the scripts above, but the result always refers to the Site
    Title, instead of my article title.
    Do you know how it happened, and what is the correct scripts?


    getTitle(); gets the title of the current document, so Maybe this will help
    Code:
    $this->params->get('page_title');
+/- Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Security Please input the anti-spam code that you can read in the image.
 

Go Daddy $7.49 .com Sale!