# Trying to get a collection from a Front Matter value

**URL:** <https://talk.jekyllrb.com/t/trying-to-get-a-collection-from-a-front-matter-value/4443>\
**Category:** Help\
**Created:** [May 17, 2020, 8:46am UTC](https://talk.jekyllrb.com/t/trying-to-get-a-collection-from-a-front-matter-value/4443 "2020-05-17T08:46:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![svondervoort](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/svondervoort/32/2518_2.png) [@svondervoort](https://talk.jekyllrb.com/u/svondervoort)\
**Post date:** [May 17, 2020, 8:46am UTC](https://talk.jekyllrb.com/t/trying-to-get-a-collection-from-a-front-matter-value/4443/1 "2020-05-17T08:46:51Z")

</div>

Hi I’m new to Jekyll and have a basic blog set up. Now my idea is to loop through a collection per blog post to get some fancy HTML going on. Because as far as I’m aware you can’t simply add HTML to the markdown.

```auto
// config.yml

collections:
  - hollowknight

```

So I’ve set up a collection named `hollowknight` and I got a blog post about Hollow Knight.  
In the Front Matter of the blog post I have `collectionid: 'hollowknight'`. And in the Layout I use for blog posts I tried the following:

```auto
// post.html

{% capture collection %}site.{{ page.collectionid }}{% endcapture %}

{% for section in collection %}
  {{ section.title }}
{% endfor %}

```

So the idea was to set the `collection` variable to `site.hollowknight` as configured in the config and the Front Matter. I set up a single article inside the collection, but it isn’t showing up.

Is there any way to realise this?

Or is there a way to use paragraphs in the Front Matter, because then I could just use arrays and objects in the Front Matter of the posts to do my magic?

Or am I just stretching to far from what Jekyll is supposed to be?

_ **Edit** _  
So it would be possbible with Front Matter arrays and objects: [https://github.com/jekyll/jekyll/issues/246#issuecomment-1639375](https://github.com/jekyll/jekyll/issues/246#issuecomment-1639375)

```auto
sections:
    - title: section 01
      videoid: 193641463
      content: |
        # Lorem Ipsum  
        is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.

        # It has survived
        not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

```

But can’t get `| textilize` to work.

* * *

_ **Edit** _

So I found out I was getting the collection the wrong way, [List collection with name from front matter](https://talk.jekyllrb.com/t/list-collection-with-name-from-front-matter/3619/6).

```auto
{% for section in site.[page.collectionid] %}
  {{ section.content | textilize }}
{% endfor %}

```

The only weird part is, everywhere I see `| textilize` being used but can’t get it to work.

---

<div class="post-metadata">

**Author:** ![michaelbach](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelbach/32/2151_2.png) [@michaelbach](https://talk.jekyllrb.com/u/michaelbach)\
**Post date:** [May 18, 2020, 4:45am UTC](https://talk.jekyllrb.com/t/trying-to-get-a-collection-from-a-front-matter-value/4443/2 "2020-05-18T04:45:37Z")

</div>

Only a comment to this:

> [@svondervoort](#):
>
> Because as far as I’m aware you can’t simply add HTML to the markdown.

You can add HTML code to markdown. Occasionally it might be necessary to add  
`markdown="1"`  
just before the closing angle bracket.

---

<div class="post-metadata">

**Author:** ![svondervoort](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/svondervoort/32/2518_2.png) [@svondervoort](https://talk.jekyllrb.com/u/svondervoort)\
**Post date:** [May 18, 2020, 7:36am UTC](https://talk.jekyllrb.com/t/trying-to-get-a-collection-from-a-front-matter-value/4443/3 "2020-05-18T07:36:29Z")

</div>

Thanks michaelbach.

Any clue where the `textilize` filter comes from or why it isn’t working.  
Can’t find anything about it in the Liquid documentation or Jekyll documentation.

Is it possible to use Markdown in Front Matter and then convert it to HTML?

---

<div class="post-metadata">

**Author:** ![svondervoort](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/svondervoort/32/2518_2.png) [@svondervoort](https://talk.jekyllrb.com/u/svondervoort)\
**Post date:** [May 20, 2020, 12:10pm UTC](https://talk.jekyllrb.com/t/trying-to-get-a-collection-from-a-front-matter-value/4443/4 "2020-05-20T12:10:51Z")

</div>

Closing this topic since I have found several solutions (See edits in original post).  
Am now coping with a new challange called [Markdown to HTML](https://talk.jekyllrb.com/t/markdown-to-html/4452).
