Forums

Site name in Page title

HerKle 15 Feb, 2012
Just another topic:

In my Global Configuration the option "Include Site Name in Page Titles" is set on "Before", i.e. "Icebreaker 2012 - ACTIVE Summer Camp - History"

This works everywhere except those pages where CF forms are shown. There the title only says eg:
"Registration".

How can I get the site name included there as well?
GreyHead 18 Feb, 2012
Hi HerKle,

Sorry, I don't know. It's probably a function of the component Router files and so far ChronoForms doesn't have one.

Bob
HerKle 26 Feb, 2012
Sorry, Bob, I don't understand your answer.
1. In your component there must be somewhere a place, where it is decided to declare the name of the form to be the title.
2. At that very place it should also be looked after the setting variable deciding whether to add the site name or not.
So if you just could tell me where this (#1) happens, I will try to add the missing code snippet which is needed to create the correct title.
Thanks!
GreyHead 27 Feb, 2012
Hi herKle,

1. In your component there must be somewhere a place, where it is decided to declare the name of the form to be the title.



a) It's not my component but Max's

b) No there isn't, forms don't have a title to declare.

If you need to set a page title then use the standard Joomla! code in a Custom Code action
<?php
$doc =& JFactory::getDocument();
$doc->setTitle('Some title');
?>

Bob
HerKle 29 Feb, 2012
Thanks. That's a first aid.

But on the long run it can't be more than a makeshift, eg. when several forms are placed on one page, the title of the last one wins the race, which might not be wanted. :-(

I am looking for s.th. more basic such as eg.

		// Check for empty title and add site name if param is set
		if (empty($title)) {
			$title = $app->getCfg('sitename');
		}
		elseif ($app->getCfg('sitename_pagetitles', 0) == 1) {
			$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
		}
		elseif ($app->getCfg('sitename_pagetitles', 0) == 2) {
			$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
		}
		if (empty($title)) {
			$title = $this->item->title;
		}
		$this->document->setTitle($title); 


To include s.th. like this into chronoforms.php would be great. Unfortunately, I could not find out so far, how the formname makes it into the title bar...
This topic is locked and no more replies can be posted.