Connect Content with Channels in Modyo

Felipe Meyer

Felipe Meyer

One of the great features that we have in Modyo is our independent content management system in Content. We're going to demonstrate how the Liquid SDK works to be able to connect Content with Channels, our web application and content manager solution.

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

In the following example, entries is assigned all entries from space 'space_uid' with type 'type_uid'.

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

Next, we display the entries using a for, printing the 'meta.uuid' and 'meta.title' from each entry.

{% for entry in entries %}
  entry: {{ entry.meta.uuid }} - Connect Content with Channels in Modyo 
{% endfor %}

Now we can generate the HTML using Liquid Drops. Using output statements we will print the meta.title and fields.name.

{{ entry.meta.title }}
{{ entry.fields.name }} 
Filters

The assign created previously will return a loop of all entries, if we want to filter them further, we can use Liquid filters in the same assignment:

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

In this example we filter by the category 'news' with tag 'devs', then we sort them by 'fields.date' with a limit of 8 entries.

To see more examples of what you can do with Liquid SDK in Modyo, see Public API Reference in Modyo Docs.

Photo by Kelly Sikkema on Unsplash.

Other Developer Tips

Channels
Carlos Solís

Carlos Solís

Customize your UI in Modyo with Modular CSS

Customizing the look and feel of your Modyo application is essential for creating unique digital experiences.

Liquid
Felipe Meyer

Felipe Meyer

Using Liquid on Modyo

Liquid is an open source template language created by Shopify and written in Ruby. At Modyo we use this language to add dynamic capabilities to our digital channels.

Insights
Carlos Solís

Carlos Solís

Strategies for reverting changes in production

Writing code is a complex task that, despite having quality control systems and peer reviews, always carries the risk of an error reaching production, learn the strategies to avoid these issues and clear methods to revert errors when they occur.