1

Just wondering how to pull content from a matrix field on my homepage into another .html file. Basically taking the content from a single and placing it into a different template. This is what I have so far:

{% for event in entry.homepage %}
    {% for block in entry.aloneImages %}
        {% for asset in block.image %}
              <img src="{{ asset.url }}" alt="{{ asset.title }}"> <br />
        {% endfor %}
        {{ block.source }}
        {{ block.credit }}
     {% endfor %}
{% endfor %}
5

You just need to define entry, which can be done with craft.entries the same way you’d fetch any other entry(s).

{% set entry = craft.entries.section('homepage').first() %}

{% for block in entry.aloneImages %}
    {# ... #}
{% endfor %}
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.