clowride VIP
Total posts: 1,022
03 Sep 2015 13:39

Hello :-) I 'am trying to use this element

JFactory::getDocument()->setTitle($item->title. ' - '. strip_tags($item->fields_by_id[46]->value));

Can you tell me at what line i need to put it please in full view record template ?

THANK YOU a lot

Last Modified: 04 Sep 2015


pepperstreet VIP
Total posts: 3,837
03 Sep 2015 16:57

Salut clowride,
watch out for the first definition:

...
$item = $this->item;
...

In the default template, this definition block is followed by some CSS inline styles.


You might place your line after the definitions block.
Or even after the inline CSS block.
Just make sure it is inside php tags.


clowride VIP
Total posts: 1,022
03 Sep 2015 17:42

hello first thank you for your help i did but i already have blank page very strange


pepperstreet VIP
Total posts: 3,837
04 Sep 2015 00:40

clowride i did but i already have blank page very strange

Right after inserting the new line?
Or did you make any other changes?

My quick test with default record template works. Tested 3 different fields and their ID's.

Excerpt from my template and position of the extra line:

...
defined('_JEXEC') or die();

$item = $this->item;
$params = $this->tmpl_params['record'];
$icons = array();
$category = array();
$author = array();
$details = array();
$started = FALSE;
$i = $o = 0;

?>
<style>
    .dl-horizontal dd {
        margin-bottom: 10px;
    }

.line-brk {
    margin-left: 0px !important;
}
<?php echo $params->get('tmpl_params.css');?>
</style>

<?php

JFactory::getDocument()->setTitle($item->title. ' - '. strip_tags($item->fields_by_id[20]->value));

if($params->get('tmpl_core.item_categories') && $item->categories_links)
{
    $category[] = sprintf('<dt>%s<dt> <dd>%s<dd>', (count($item->categories_links) > 1 ? JText::_('CCATEGORIES') : JText::_('CCATEGORY')), implode(', ', $item->categories_links));
}
if($params->get('tmpl_core.item_user_categories') && $item->ucatid)
...

Turn error reporting on, if you can't get back to a working page.


clowride VIP
Total posts: 1,022
04 Sep 2015 06:13

Thank you very good i did things like that but blank page and no error reporting :-( so strange


clowride VIP
Total posts: 1,022
04 Sep 2015 06:16

What it is strange is when i remove this line after blank page persist :-o


pepperstreet VIP
Total posts: 3,837
04 Sep 2015 06:20

clowride blank page and no error reporting :-( so strange

Error reporting set to MAX should display something.

Anything else published on that particular page?
Replace record template with a fresh copy. Any difference?


Sergey
Total posts: 13,748
04 Sep 2015 06:31

clowride VIP
Total posts: 1,022
04 Sep 2015 06:52

Thank you Sergey and Pepperstreet i have this error Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/xxxxxx/public_html/index.php:2) in /home/xxxxxxxxx/public_html/libraries/joomla/session/session.php on line 665


Sergey
Total posts: 13,748
04 Sep 2015 12:23

Some fils you customized has whitespace in it. I think in index.php before <?php there is whitespace.


pepperstreet VIP
Total posts: 3,837
04 Sep 2015 13:48

Sergey is on the right track. If you google your error, you will find a lot of similar posts/issues.
- either whitespace
- or wrong encoding of your file (or configuration file)

Powered by Cobalt