0
Welcome Guest! Login
0 items Join Now

customising title tags in the template / displayHead function

  • customising title tags in the template / displayHead function

    Posted 11 years 3 weeks ago
    • I have anacron template, with a joomla 3.2.3.

      I would like to append a string to a large number of k2 item pages and am wondering whether this could be achieved in the template index.php.

      Joomla docs suggest this is possible in the normal head tag
      docs.joomla.org/Customising_the_dynamic_page_title

      But gantry runs its own displayHead function. Any suggestions for how to modify the title on the basis of catid or itemid etc?

      thanx.
    • David Goode's Avatar
    • David Goode
    • Preeminent Rocketeer
    • Posts: 17058
    • Thanks: 890
    • Web Designer and Host

    Re: customising title tags in the template / displayHead function

    Posted 11 years 2 weeks ago
    • Hi there,

      Have you tried inserting the code in the index.php file after the gantry call but before </head>?

      This would make mmore sense as every gantry update would trash your changes.

      Hope this helps 8)

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information
  • Re: customising title tags in the template / displayHead function

    Posted 11 years 2 weeks ago
    • How would that not leave two copies of the title tag?

      Anyhow it helps insofar as I can take your reply as meaning - no it's not possible.

      I presume a plugin will be the next option and change the title on the function onBeforeCompileHead()

      By I am not sure how gantry works with that.

      I guess I will find out.
    • David Goode's Avatar
    • David Goode
    • Preeminent Rocketeer
    • Posts: 17058
    • Thanks: 890
    • Web Designer and Host

    Re: customising title tags in the template / displayHead function

    Posted 11 years 2 weeks ago
    • Hi Jared,

      I have to guess by your comments that you did not bother to even try my suggestion?

      Having done some further digging through a clean install I find that the displayHead() is referenced in the libraries/gantry/core/gantry.class.php file. It is shown as this...
      	public function displayHead()
      	{
      		if (defined('GANTRY_FINALIZED')) return;
      		//stuff to output that is needed by joomla
      		echo '<jdoc:include type="head" />';
      	}

      Based on that you could still use the code suggested by the Joomla link you provided but place it before the gantry call and exclude the <jdoc:include type="head" />

      Hope this helps 8)

    • Please search forums before posting. Please make sure your post includes the version of the CMS you are using and a link to the problem. Annotations on screenshots can also be helpful to explain problems/goals. Please use the "secure" tab for confidential information

Time to create page: 0.062 seconds