Connect content with channels in Modyo

One of the great potentialities that we have in Modyo is the independent content management of the channel where we deploy it, and that is why here we are going to understand how the Liquid SDK works to be able to connect these two modules.

The first thing we have to do is have a Space and a Type with content already loaded, and with an assign of liquid we are going to call them from a page.

{% assign entries = spaces['space_uid'].types['type_uid'].entries %}

And then do a For in liquid

{% for entry in entries %}
  entry: {{ entry.meta.uuid }} - {{ entry.meta.title }} 
{% endfor %}

Now we can generate the html of how we present our input, for the fields that we have in Modyo by default we are going to use meta and for the custom fields of the type we use fields.

{{ entry.meta.title 
{{ entry.fields.excerpt }} 

The assign that we use will bring us a loop of all the entries in content, but if we want to filter we can do the assign in the same.

{% assign entries = spaces['space_uid'].types['type_uid'].entries | by_category: 'news' | by_tag: 'devs' | sort_by: '' , 'desc' | limit 8%}

In this case what we did was filter by a category, then a tag sort them by a specific field and then tell the assign to only bring 8 entries.

If you want to have more information about the Liquid SDK check Modyo Docs.


Felipe Meyer

Felipe Meyer