Relation reverse field: HTML [solved: almost]

More
10 years 9 months ago - 10 years 8 months ago #49553 by marc.light
Hi,

In the HTML of a relation field, I can display other fields data, works good.

How can display a relation field? The relation filed in question is not linked to the reverse relation field.

Thanks for your help.
Last edit: 10 years 8 months ago by marc.light.

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

More
10 years 9 months ago #49554 by ggppdk
Hello

it should be possible to render relation via a relation field but to avoid loops the relation field will not do it,

we cannot trust if users will configure a loop, in future we may implement detection of loop and allow to render a relation field

there is this line in
components/com_flexicontent/classes/flexicontent.fields.php

if absolutely needed then you may change:
$disallowed_fields = array('relation', 'relation_reverse');

to be:
$disallowed_fields = array('nothing');

but note that this is hack, and we do not support this


-- 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...

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

More
10 years 9 months ago #49578 by marc.light
I don't like hacks, it's hard to follow when updates are made, but thanks for not leaving me hanging.

The only reason I'm using a relation field is to get the link to the item. Is there a way to get that link by using a select field if I use a SQL query?

I have read this post with no luck:
www.flexicontent.org/forum/index ... pic#p49451

Here is my SQL query:

SELECT id AS value, title AS text FROM #__content WHERE state="1" AND language="fr-FR" AND (catid='151' OR catid='158' OR catid='277' OR catid='278')

Hope I'm not streching my luck here and thanks again for your great support.

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

More
10 years 9 months ago #49626 by marc.light
I was able to do it with the sourcerer plugin.

Frontend display: value

Prefix:
<a href="{source}<?php echo JRoute::_('index.php?option=com_flexicontent&view=item&id=

Suffix:
');?>{/source}">{source}<?php $article =& JTable::getInstance("content"); $article->load({{fieldname}}); echo $article->get("title"); ?>{/source}

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

More
10 years 8 months ago #49677 by marc.light
I need help again...

I forgot about the language, the site is bilingual so I need a way to get the association ID of the item. I think the easiest way would be to generate links in both languages and show/hide with CSS as I have a class for the languages.

Prefix
<a class="link_fr" href="{source}<?php echo JRoute::_('index.php?option=com_flexicontent&view=item&id=

Suffix
');?>{/source}">{source}<?php $article =& JTable::getInstance("content"); $article->load({{fieldname}}); echo $article->get("title"); ?>{/source}<a class="link_en" href="{source}<?php echo JRoute::_('index.php?option=com_flexicontent&view=item&id={source}<?php $lang_parent =& JTable::getInstance("flexicontent_item_ext"); $lang_parent->load({{fieldname}}); echo $lang_parent->get("lang_parent_id"); ?>');{/source}">{source}<?php $article =& JTable::getInstance("content"); $article->load({{fieldname}}); echo $article->get("title"); ?>{/source}

The title is the same in both languages so I don't need to get the association title.

I don't know if any of this makes sense or if there's a better way to do it. Any help will be really appreciated.

Thanks.

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

More
10 years 8 months ago #49678 by ggppdk
Hello

please try changing the files (hack) that is suggested,
and test



and make a note of this, to restore this change when you upgrade

we will examine allowing rendering relation fields, in a future release


-- 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...

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

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