Relation reverse...tricky

More
6 years 11 months ago #71483 by Chabi01
Hi everybody,
I have a site with 2 types. Each type have their fields.
Each item in content are linked : one content of the first type can have multiples contents of the second type.

In the first type, i use an image for each content (a photo of a person)
In the second type (event for the person), i want in the category view show the event but show in the list for each event the photo, adresse, email of the content linked by relation (the person)
(hope everybody understand :D )

So :
Type 1 : persons
Type 2 : events

How to : When i show the category view of the events, i would like to see also in my list the identity of the person...

Is this possible in the category view ? If so, how could i achieve this ?

Thanks ! :)
Xavier

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

More
6 years 11 months ago #71486 by ggppdk
Replied by ggppdk on topic Relation reverse...tricky
Hello

depending on direction of relation add the relation or relation reverse field into the category view
e.g.
if person related to many events then ... add in category view the reverse relation field
if event related to a person then ... add in category view the relation field itself

then edit the field configuration and inside "Viewing TAB", "Total count TAB" enable override and configure the
- item HTML parameter
to show what you need , e.g. the picture of person (aka the image field)


-- 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
6 years 11 months ago #71516 by Chabi01
Replied by Chabi01 on topic Relation reverse...tricky
Hi Georges,
Thanks for this (sorry for the delay in my response : mailbox transfer delay..)

To be sure to understand i give in details what i have...
I have 2 types : persons and events In each type, i have some fields.
I also have a category for the persons and one for the events (so, i have for each a type and a category).
Each persons (unique) can have many events (multiple then ;)

I have added a relation reverse for the type persons to allow me to select in an events the person (right ?) : this way, when i create a new event, i can see a dropdown list to select my person in my event (cool :D )

The reverse field is setted up on the event on the date of the events and setted up on the type "person".

You write me to edit the field configuration (of the relation field ?)... I don't see how to achieve this...

For now, when i show a person, i can see all the date (the relation) in my item view for the person.
I would like to see in the item detailed and category view some selected information of the person : that's what i'm not sure to understand in your explanation...

Thanks for your time Georges :)
Xavier

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

More
6 years 11 months ago #71551 by Chabi01
Replied by Chabi01 on topic Relation reverse...tricky
Hi,
To complete : i write my template by myself for the categories and item views and what i would like to understand, it's how i could use the field in the template (with the "item(name)->display" usual way) when i want to use a field from the other type in relation...

Xavier

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

More
6 years 10 months ago #71609 by Chabi01
Replied by Chabi01 on topic Relation reverse...tricky
Hi Georges,
I tried...
in the "total count tab", i have (in french) "Activate total : non (by default), yes, yes and hide zero".
I have then item html where i can if i'm not wrong replace "__display text__" with something like "__display_text__<br>{{myfield}}" (right ?)
Ok, but i don't find how to change my template as i use my field in "render only" mode because i create my own view in the item template or category template...

If i want to use the photo of the person in each line of my template, i use something like :
Code:
echo $this->fields['personphoto']->display;

So how to call fields from the relation reverse item like this (Photo, name, adresse,...)
You see what i mean ?
Xavier

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

More
6 years 10 months ago #71617 by ggppdk
Replied by ggppdk on topic Relation reverse...tricky
Hello

you could do as you said

I have then item html where i can if i'm not wrong replace "__display text__" with something like "__display_text__<br>{{myfield}}" (right ?)


and then use:
Code:
echo $this->fields['reverse_relation_fieldname']->display;

isn't the above enough ?


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