How to access fields of a content type in another content type

More
6 years 1 month ago - 6 years 1 month ago #71663 by rgu_it_web
Hello,

We have two content types called Course and School. Every Course object is linked to a School object by a Relation field.

We want to access the fields (both core and user-defined) of the related School Object within item_html5.php of the Course type.

Something like this

$this->fields->fields

or

$this->fields->fields

Is there any way to achieve this?

Thanks,
Last edit: 6 years 1 month ago by rgu_it_web. Reason: Does not display the code snippets properly

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

More
6 years 1 month ago #71680 by micker
in relation field you have a option to create your template and call field value of item in relation
in futur pro version we can call value by plugin {idfield##iditem##value}

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
6 years 1 month ago #71685 by rgu_it_web
Thank you for your response. Would you please elaborate a bit more? Please give a step by step method or please point us towards any documentation that explains this.

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

More
6 years 1 month ago - 6 years 1 month ago #71686 by ggppdk
hhmm

this is available inside the relation field during its display creation


i am thinking (for both item view and for category view)
of exposing it to the templates like

Code:
$item->fields['relation_field1']->relitems[0]->fields $item->fields['relation_field1']->relitems[1]->fields $item->fields['relation_field1']->relitems[2]->fields

(in item view $this->fields is a reference to $item->fields)

please note i am thinking to allow the above,
now the above is not usable


-- 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...
Last edit: 6 years 1 month ago by ggppdk.

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

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