Item title before category title with sh404sef?

More
14 years 2 weeks ago #21797 by victorio404
Hi i'm using flexinontent r1057 with sh404sef. Everything is working great except the generated Titles are like this: "Category-name - Item-name | Site-name". Can't find a way to switch places like this: "Item-name - Category-name" even if i disable adding category and section in title from sh404sef configuration it is always Category-name - Item-name.
I assume the file "/components/com_flexicontent/sef_ext/com_flexicontent.php" have to be edited? Is there a way of changing that?

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #21807 by ggppdk
-- The setting of page_title is not related to sef component.

-- The setting of page_title is inside file
component/com_flexiconent/views/items/view.html.php
this file is not overridable

-- But you can copy code from the above file inside your template file:
component/com_flexiconent/templates/mytmpl/item.php
and change it e.g.
Code:
$cid = JRequest::getInt('cid', 0); //get item data $item = & $this->item; $params = & $this->params; $cats = new flexicontent_cats($cid); $parents = $cats->getParentlist(); $document = & JFactory::getDocument(); $menus = & JSite::getMenu(); $menu = $menus->getActive(); if ($params->get('override_title', 0)) { if ($params->get('custom_ititle', '')) { $params->set('page_title', $params->get('custom_ititle')); } else { $params->set('page_title', $item->title); } } else { // Get the menu item object if (is_object($menu)) { $menu_params = new JParameter( $menu->params ); if (!$menu_params->get( 'page_title')) { $params->set('page_title', $item->title); } } else { $params->set('page_title', $item->title); } } /* * Create the document title * * First is to check if we have a category id, if yes add it. * If we haven't one than we accessed this screen direct via the menu and don't add the parent category */ if($cid && $params->get('addcat_title', 1) && (count($parents)>0)) { $parentcat = array_pop($parents); $doc_title = $params->get( 'page_title' ) . (isset($parentcat->title) ? ' - '.$parentcat->title:""); } else { $doc_title = $params->get( 'page_title' ); } $document->setTitle($doc_title);

-- Effectively the above code sets the title again PLACING category name after item title.
if you need further change title then edit these are the final lines:
if () {
$doc_title = ...
} else {
$doc_title = ...
}

I hope this will be useful too many people, must remember to put it in the new upcoming FAQs

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #21808 by micker
i copy it ! lol

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #21825 by victorio404
Thanks.
I did that and now the title is ok.
But in RSforms i'm using
//<code>
$doc = & JFactory::getDocument();
return $doc->getTitle();
//</code>
in hidden field in order to send item title(the form is inside the flexicontent item). In the received form instead of the item title is the category title. Do you know how to get the item title in Rsforms?

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #21837 by ggppdk
1. You mean you are displaying an item and you have Rforms module, and you need to automatically fill in some fields of the form?

If so you can do in 2 ways:
a. edit the template module if module has templates, retrieve item data and use them
-- OR what i do in my sites --
b. Use PHP and javascript inside FLEXIcontent item to populate RSforms fields with data


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #21839 by victorio404
not module - the Rsform is inserted into flexicontent item via plugin. The field is hidden and it has to get the item title and send it on submission. The code i have works, but for some reason gets the category Title instead of Item title. I was hoping to resolve that by displaying Item title before category title, but i still get the category title in the e-mail.

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #21843 by ggppdk
Getting flexicontent field value to a custom CKform or RSform is a common request i am thinking of adding this to the new documentation of the site.

About what you ask, it sounds easy to me, can you past the code of the form (not ALL the form only the hidden field) and the code you use to add the item title to the field?

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #21852 by victorio404
//<code>
$doc = & JFactory::getDocument();
return $doc->getTitle();
//</code>
this is the whole code of the hidden field(got it from RSform support: www.rsjoomla.com/support/documen ... title.html )
It was working ok with SOBI2 before.

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #21854 by ggppdk
aaa, i see that your code is inside RSFORM code !!!

So, your code is probably executed, before the FLEXIcontent code sets the page title, i guess the page title you get is the title of currently active menu item which points to a category.

USE this (WILL WORK only in flexicontent item view not in category view, so do not display the load module field in category view)
Code:
$db = & JFactory::getDBO(); $fcitem_id= JRequest::getInt('id',0); $fccat_id= JRequest::getInt('cid',0); $view= JRequest::getVar('view'); if ($view!='items' && $view!='article') { return "not in items view"; } if ($fcitem_id) { $query = 'SELECT c.* ' .'FROM #__content AS c ' .'WHERE c.id = ' . $fcitem_id; $db->setQuery($query); $itemdata = $db->loadObject(); $item_title = $itemdata->title; } if ($fccat_id) { $query = 'SELECT c.* ' .'FROM #__categories AS c ' .'WHERE c.id = ' . $fccat_id; $db->setQuery($query); $catdata = $db->loadObject(); $cat_title = $catdata->title; } return $item_title." - ".$cat_title;

in the above code if you only want item title then replace last line with:
return $item_title;

Also consider leaving review for FLEXIcontent in JED

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
14 years 2 weeks ago #21859 by victorio404
Perfect solution as always, thank you! :) I can't believe FC a free component, absolutely awesome.
Did the review on JED BTW :)

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save