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

I build a questionnaire tool. I have three type of answers, each stored in a separate type of template. Now I can create questionnaires (fragebogen) and ther arrange the questions and their order using a repeatable region.

In the repeatable region only the id of the question is stored.

Every answer is related to the questionnaire (fragebogen), to the question (frage), to the customer (anfrager) and to the craftsman (anbieter).

See attached file with the templates ...

No I want to evaluate the answers to specific questions.

I tried like that:
Code: Select all
<table class="table table-bordered table-striped">
   <thead>
      <tr>
         <th>Datum</th>
         <th>Anbieter</th>
         <th>Anfrager</th>
         <th><cms:get_custom_field 'frage' masterpage='befragung/fragen.php' id=frage_id limit='1' /></th>
      </tr>
   </thead>
   <tbody>
   <cms:pages masterpage='befragung/antworten_offertstellung.php' custom_field="fragebogen==<cms:show fragebogen_id />|frage=<cms:show frage_id />" orderby='publish_date' order='desc'>

      <cms:set anfrager_name="<cms:related_pages 'anfrage'><cms:show nachname  />, <cms:show vorname  /></cms:related_pages>" />

      <tr>
         <td><cms:show k_page_date /></td>
         <td><cms:show k_page_title /></td>
         <td><cms:show anfrager_name /></td>
         <td><cms:show antwort /></td>
      </tr>

   </cms:pages>
   </tbody>
</table>


The problem is, since the editables "anfrage", "frage", "fragebogen", ... are of type relation, I cannot access thir values using "<cms:show ... />". Since I need to filter out answers related to a specific "frage" ans a specific "fragebogen", I have no chance to realize it with <cms:related_pages ... > tag.

Any idea how to filter similar to custom_field=... or how to get out the values stored in the relation fields with php?

I'm totally stuck ...

Attachments

Hi, please make sure about proper wording of custom_field value, because relations can be filtered via value of related page (name) or id of related page. See the sample from docs - viewtopic.php?f=5&t=8581 -
2018-08-23-001.png
Filtering relations
2018-08-23-001.png (37.67 KiB) Viewed 1358 times
2 posts Page 1 of 1