[Plugins] Link content inside Flexicontent

More
14 years 9 months ago #3534 by yopyop001
Hi,

Yes, it was on the TODO list for next update.

I will update soon the plugin but for now you can modify the query on the DisplayFieldValue fonction :

In the select_flexiitem.php
Code:
$field_elements= 'SELECT DISTINCT i.id as value, i.title as text, i.catid as catid,' .' CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(\':\', i.id, i.alias) ELSE i.id END as itemslug' .' FROM #__content as i' .' LEFT JOIN #__flexicontent_fields_item_relations AS fi_rel ON i.id=fi_rel.value' .' LEFT JOIN #__flexicontent_cats_item_relations AS rel ON rel.itemid = i.id AND rel.catid=i.catid' .' WHERE fi_rel.field_id='.$field->id .' AND fi_rel.item_id='.$item->id .$orderby ;

and change the line
Code:
$link="<a href=\"".JRoute::_(FlexicontentHelperRoute::getItemRoute($result->value))."\" >";
By
Code:
$link="<a href=\"".JRoute::_(FlexicontentHelperRoute::getItemRoute($result->itemslug)) ."\" >";

For the select_flexiitem_reverse.php file, you have to adapt the query on the same way (add
Code:
.' CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(\':\', i.id, i.alias) ELSE i.id END as itemslug'
on the query and load result->itemslug to generate the link.

I hope it'll work.
Rgds

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

More
14 years 9 months ago #3640 by micker
la mega classss !
bravo

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 9 months ago #3683 by vlester
Excellent ! Just what I needed to show an author link.
Thanks a lot.

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

More
14 years 8 months ago #4756 by vlester
Hello,
I also noticed a problem with the sef url using this plugin (not the same problem than ComposerRyan: the alias of my articles display in a correct way):
I have created a category "Authors" to link authors to their articles with this plugin.
When I create a new author (new item with a type "author"), there is the name of a menu added in front of the url. Not always the same menu. Whatever, this menu is not at all related with this author and should'nt be here. And also, the url of the articles linked to an author changed in the same way.
For example what shoud be :
wwww.mysite.fr/category-authors/eric-gallo
is
wwww.mysite.fr/menu-that-shoudnt-be-here/categroy-authors/eric-gallo

I created a flexicontent menu on my front page linked to the category "authors" and it solved the problem: now my url become wwww.mysite.fr/menu-authors/category-authors/eric-gallo
But in the back-end, when I go to the component AceSEF/Sef Urls, there are now two sef url created (the one with the weird menu and the correct one) for each article created with this plugin activated.
I can delete them one by one or just let them be there I guess. I just wanted to notice you the problem.

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

More
14 years 7 months ago #5227 by ewel
Changing select_flexiitem.php worked, but if I make those changes to select_flexiitem_reverse.php the plugin no longer shows the links that were there.

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

More
14 years 7 months ago #5276 by yopyop001
Hi,

May be a ',' after 'title as text' was missing.

Here is a temporary query for select_fexiitem_reverse.php:
Code:
$field_elements= 'SELECT DISTINCT id as value, title as text,' .' CASE WHEN CHAR_LENGTH(i.alias) THEN CONCAT_WS(\':\', i.id, i.alias) ELSE i.id END as itemslug' .' FROM #__content as i' .' LEFT JOIN #__flexicontent_fields_item_relations AS fi_rel ON i.id=fi_rel.item_id' .' LEFT JOIN #__flexicontent_cats_item_relations AS rel ON rel.itemid=fi_rel.item_id' .' WHERE fi_rel.field_id='.$reverse_field .' AND fi_rel.value='.$item->id .$orderby ;

I have to fix the menu bug (see vlester post) and update the files.

Regards.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.508 seconds
Save
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