I'm writing a plugin that stores YAML in _storage. I want to be able to access that data in my templates.

I've got the initial storage working fine with $this->storage->putYAML($file_name, $array);. This is what the file in storage ends up looking like:

---
- Value One
- Value Two

Now I want to do this in my templates:

<ul>
  {{ my_plugin:method var="storage_file_name" }}
    <li>{{ value }}</li>
  {{ /my_plugin:method }}
</ul>

I tried Parse::tagLoop(); and Parse::frontMatter(); to no avail.


I thought maybe I need to be redundant and assign a variable name in the YAML:

---
storage_file_name:
  - Value One
  - Value Two

…then do this in my template:

<ul>
  {{ my_plugin:method var="storage_file_name" }}
    {{ storage_file_name }}<li>{{ value }}</li>{{ /storage_file_name }}
  {{ /my_plugin:method }}
</ul>

…but that didn't work either. What should I try?

Answered by Curtis Blackwell! Go to answer.