New Relationship field Related Questions

Skip to first unread message


Oct 1, 2021, 6:56:50 AM10/1/21
to dotCMS User Group
I  have few queries in terms of new Relationship field . Can someone please clarify my doubts

Lets take A, B are two structure where  In structure A a new relationship field is created for B contents

1. After relating the content from B with A. How can I set the desired fields from B to show up under this relationship field  in A ?
Here  lets assume B has more than 5 fields, I wanted to make one or two fields to show up in the relationship field in A to easily identify them in A just by looking at them

2. The legacy relationship fields used to maintain the order in which you stack the content when you pull them using Query/view tool method for UI . Can we do the same here with this new Relationship field ? For me its not working when I tried it.
dotCMS version : 5.3.4

Thanks in advance. 

Nollymar Longa

Oct 4, 2021, 10:51:18 AM10/4/21
to dotCMS User Group
Hi Visu.

Here my answers for your doubts: 

1. There is a way to do it, using field variables. You have to define a field variable in the relationship field with key=showFields. The value is a comma-separated list of the velocity variable names of the fields you want to display. For example:value=title,contentHost,urlTitle. For further details, you can take a look at the GitHub issue where it was implemented:

2. The order should be preserved. Can you please share the code you are using to pull relationships? 


Reply all
Reply to author
0 new messages