{% comment %} MODIFIED: This version can accept an 'id' parameter. Usage: {% include feature_row id="my_data_block" %} (It defaults to "feature_row" if no id is provided) {% endcomment %} {% comment %} --- 1. Get the data block --- {% endcomment %} {%- assign feature_row_id = include.id | default: "feature_row" -%} {%- assign feature_row_data = page[feature_row_id] -%} {% comment %} --- 2. Render the data block (this is your original code) --- {% endcomment %} {% if feature_row_data %} {% if feature_row_data.first.image_path %}
{% else %}
{% endif %} {% for item in feature_row_data %}
{% comment %} --- This part makes the image clickable --- {% endcomment %} {% if item.image_path %} {% endif %}
{% comment %} --- This part makes the title clickable --- {% endcomment %} {% if item.title %}

{{ item.title | markdownify }}

{% endif %} {% if item.excerpt %}

{{ item.excerpt | markdownify }}

{% endif %}
{% endfor %}
{% endif %}