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

Carlos Solís

Carlos Solís

Instant Image Optimization with Liquid in Modyo

Optimizing images is essential for any website, especially if you’re aiming for fast load times and a great user experience.

Customers
Carlos Solís

Carlos Solís

Creating Forms in Modyo

Forms are fundamental in any financial application. They help capture critical user information, such as personal data, preferences, and financial details.

Widgets
Carlos Solís

Carlos Solís

Enabling Debug Mode in Modyo CLI

Debugging is an essential part of software development. It allows us to identify and fix errors, optimizing the performance and stability of our applications.