Copy link to clipboard
Copied
I am using liquid to cycle through all the items of a webapp and output the various fields. This works fine but for some reason I cannot output the description field.
The following code is a simplified version of what I am using:
{module_webapps id="26025" collection="tutors" filter="all" template=""}
{% for tutor in tutors.items %}
{{tutor}}
{{tutor.name}}
{{tutor.description}}
{{tutor.["external website"]}}
{% endfor -%}
The {{tutor}} tag outputs an array of all the fields for the current web app item except the description, so I guess it is unsurprising that {{tutor.description}} also does not work. Why is this?
When using the template (which I don't want to do) the {tag_description} works as expected.
Does anyone know how can I access the description field when using liquid in this way?
Copy link to clipboard
Copied
Because your outside the scope of templates. This is a known issue that will get addressed.
But as a solution for you now..
{module_webapps id="26025" render="collection" filter="all" template="YOURTEMPLATEPATH"}
Rather then one item, the collection will be passed to the template instead and all the information for that object will be available.
Copy link to clipboard
Copied
Thanks Liam but this was not quite what I was after. If I understand you correctly your solution would require that I use the template which I do not want to do. Roberts trick seemed to do the job.
edit:
"If your doing the collection inline as you want to manage it with other data on the page/template - cool"
^ this
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Not quite Robert.
Covered this with the guys when in Romania. I think this and a number of other bugs are not addressed yet due to the migration process.
Copy link to clipboard
Copied
Thats... crazy.
Thanks for the help. This worked beautifully.
Copy link to clipboard
Copied
As a note Tom,
If your doing the collection inline as you want to manage it with other data on the page/template - cool, But if not - To keep it clean render="collection" to template is a better method. Keeps your code organised.