Skip to content

Instantly share code, notes, and snippets.

@wvuwebgist
Last active November 22, 2019 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wvuwebgist/ed366160f337cfdb5d52c34407a7d378 to your computer and use it in GitHub Desktop.
Save wvuwebgist/ed366160f337cfdb5d52c34407a7d378 to your computer and use it in GitHub Desktop.
Assign the tags/labels you want to pull dynamically via Custom Data in CleanSlate CMS.
---
layout: default
custom_data_attributes:
- tags_to_pull
---
<!--
Step 1: ☝️ Add the `tags_to_pull` custom data attribute to the
page template you want to output the feed on.
-->
<h2>Configuring tags/labels to pull dynamically via Custom Page Data</h2>
<r:set_var name="blog_context_tags" value={$tags_to_pull}" />
<!--
Step 2: ☝️ Since we're using `get_page_id` below, we have to assign the tags
in *this* page's custom data into the context of the blog index page.
-->
<r:get_page id="1234"> <!-- Step 3: 👈 Change the ID to your blog index's page ID -->
<r:articles:each tags="{$blog_context_tags}" tags_op="any">
<ul>
<li><a href="<r:article:url />"><r:article:name /></a></li>
</ul>
</r:articles:each>
</r:get_page>
<!-- For more background, see: https://github.com/wvuweb/cleanslate-cms/issues/256 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment