Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello,

I am using the following code:
Code: Select all
        <cms:pages masterpage="contrats.php" custom_field="contact_dropdown=<cms:show k_page_name/>">
         <tr>
         <td class="col-checkbox">
         </td>
        <td class="col-my_uid"><cms:show my_uid /></td>
        <td class="col-title"><a href="#" title="asddas"><cms:show conferencier_dropdown/></a></td>
        <td class="col-date"><cms:show k_page_date/></td>
        <td class="col-actions">
          <a class="icon tt" href="#" title="Modifier"><svg class="i"><use xlink:href="<cms:show k_site_link />edit/theme/_system/assets/open-iconic.svg#pencil"></use></svg></a>
          <a class="icon tt" href="#" target="_blank" title="Voir"><svg class="i"><use xlink:href="<cms:show k_site_link />edit/theme/_system/assets/open-iconic.svg#magnifying-glass"></use></svg></a>
          <a class="btn btn-actions" role="button" tabindex="0"><svg class="i"><use xlink:href="<cms:show k_site_link />edit/theme/_system/assets/open-iconic.svg#ellipses"></use></svg></a>
        </td>
        </tr>
      </cms:pages>


My issue here is that "conferencier_dropdown" field is a Relation editable in the "contrats.php" page. And in the "contrats.php" page, that "conferencier_dropdown" relation field is related to a "conferenciers.php" page. That's where it gets the data from.

When I visit the page, the "conferencier_dropdown" spot is empty. Nothing appears there, for some reason.
Am I missing something about relation fields?

Here's the code for the "conferencier_dropdown" editable in the "contrats.php":
Code: Select all
<cms:editable type='relation' name='conferencier_dropdown' group="conferencier" label="Dropdown Relation" masterpage='conferenciers.php' has='one' order="1"/>


All the other fields are working, except that one.

Thanks a lot
Hi,

Complex editable types like relation, repeatable, mosiac etc. require the help of another auxiliary tag to properly display their compound data. That is to say, using a plain <cms:show /> won't work with these types.

The tags in question for relation regions have been discussed prominently in the docs - http://docs.couchcms.com/concepts/relat ... ated-pages

For your use-case, at the place where you are trying to use <cms:show /> for displaying the related pages i.e.
Code: Select all
<cms:show conferencier_dropdown/>

using the following instead should work -
Code: Select all
<cms:related_pages 'conferencier_dropdown' >
    <!-- All variables of related pages from 'conferenciers.php' are available here -->
    <cms:show k_page_title /><br/>
</cms:related_pages>

Hope this helps
Thank you so much KK.
I have read more about relationships, and I understand it better now.

Thanks again for the awesome support!
3 posts Page 1 of 1