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

2 months 2 weeks ago - 2 months 2 weeks 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,

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

2 months 2 weeks 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.

2 months 2 weeks 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.

2 months 2 weeks ago - 2 months 2 weeks 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

$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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.