Search code examples
twigcontent-typebolt-cms

Bolt CMS - fetch content from contenttypes.yml


I'm currently on this feature, but a solution is far for me. I've tried many things, but i'm turning around my self.

Example: In the Content type "Entries" are more entries. I added a field with "type=select" and "values: entries/title". How can i fetch the content from these "values" in the twig file?

Has anyone Ideas or Tipps?


Solution

  • you can use the following for the select field:

    values: entries/id,title
    

    So it saves the ID of the selected entry. Then in your template do the following to get the record:

    {% setcontent selected_entry = 'entries/' ~ record.your_select_field %}