Issue with shortcode snippets in repeatable field group in Forestry.io CMS

The snippets are all working fine when it comes from the main .Content but I have created a repeatable field group as this template will effectively have multiple sections on a page.

The objective here is to get the snippets inside content = “## Understand the need for…” working.
I didn’t anticipate this and don’t really have a starting point for how to rectify this so any help will be greatly appreciated. Thanks

.md file

+++

layout = "template-b"

sub_title = ""

title = "The IHDP Approach"

[seo]

meta_description = ""

seo_title = ""

[[section]]

background_colour = "Green"

content = "## Understand the need for change\n\n{{% icon name=\"eyes\" %}}\n\nIHDP engaged stakeholders at the outset to understand local, regional and national experiences of cancer data and analysis, learn about enablers and challenges to data utilisation, and requirements for a Scottish Cancer Intelligence Framework.\n\n{{% /icon %}}\n\nVestibulum per metus facilisis aptent neque fermentum fringilla amet mi sit ornare sem volutpat pretium per vulputate est pulvinar a a tellus adipiscing parturient imperdiet metus erat vitae.\n\n{{% highlight-box %}}\n\n**Scotland has five cancer centres..**.\n\n* Item 1\n* Item 2\n* Item 3\n\n{{% /highlight-box %}}\n\n{{< cta-button link=\"/impact-stories/link\" >}}SCRIS impact story{{< /cta-button >}}"

title = "Understand"

+++

{{% icon name="eyes" %}}

IHDP engaged stakeholders at the outset to understand local, regional and national experiences of cancer data and analysis, learn about enablers and challenges to data utilisation, and requirements for a Scottish Cancer Intelligence Framework.

{{% /icon %}}

Vestibulum per metus facilisis aptent neque fermentum fringilla amet mi sit ornare sem volutpat pretium per vulputate est pulvinar a a tellus adipiscing parturient imperdiet metus erat vitae.

{{% highlight-box %}}

**Scotland has five cancer centres..**.

* Item 1

* Item 2

* Item 3

{{% /highlight-box %}}

{{< cta-button link="/impact-stories/link" >}}SCRIS impact story{{< /cta-button >}}

Doesn’t look like its possible

1 Like

I only have three shortcodes I’m going to use here. Two can be fixed by using a simple replace on the string but the CTA button one will require some sort of regex/pattern match to extract the link.

{{< cta-button link=\"/impact-stories/link\" >}}SCRIS impact story{{< /cta-button >}}

If I can sort this, I don’t think it will be too difficult, then I will stay with Hugo as its my preferred option.

Just in case anyone comes across this same issue it looks like the easiest solution for me is to do HTML snippets in Forestry so no need for shortcodes in Hugo in this instance. The users will only be replacing an example class name, an example Url and/or adding inner copy depending on the snippet.

CTA button .snippet file

<a href="/add/cta/button/url/here" class="button">
Enter CTA button text copy here
</a>

Simply markdownify the string
{{ .content | markdownify }}

1 Like