Call Data from One Page to Another
{% set module_name = "Event Module" %} {# Set the name Of module #}
{% for targeted_module in page_by_id(module.select_page).widgets %} <!--select_page || page option -->
{% if targeted_module.body.widget_name == module_name %}
{% set eventList = targeted_module.body.add_event %}<!--add_event || Group name of filled data -->
<h2>Upcoming Events</h2>
<div class="event-module">
<div class="event-item-wrapper">
{% for item in eventList|sort(False, False, 'date') %}
{% if loop.index <= module.number_of_item_to_show %}
<div class="event-item">
<div class="event-image">
{% if item.image.src %}
<img src="{{ item.image.src }}" alt="{{ item.image.alt }}" width="{{ item.image.width }}" height="{{ item.image.height }}">
{% endif %}
</div>
<div class="event-content-wrapper">
<h3>{{ item.title }}</h3>
<div class="by-line">
<span class="display-date">{{ item.date|datetimeformat('%B %e, %Y') }}</span> |
<span class="location">{{ item.location }}</span>
</div>
<div class="event-description">
<br>
{{ item.description|truncatehtml(150,"...") }} <a href="{{ page_by_id(module.select_page).absolute_url }}#event-item-{{ loop.index }}" class="more-link">Read More</a>
</div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
{% for targeted_module in page_by_id(module.select_page).widgets %} <!--select_page || page option -->
{% if targeted_module.body.widget_name == module_name %}
{% set eventList = targeted_module.body.add_event %}<!--add_event || Group name of filled data -->
<h2>Upcoming Events</h2>
<div class="event-module">
<div class="event-item-wrapper">
{% for item in eventList|sort(False, False, 'date') %}
{% if loop.index <= module.number_of_item_to_show %}
<div class="event-item">
<div class="event-image">
{% if item.image.src %}
<img src="{{ item.image.src }}" alt="{{ item.image.alt }}" width="{{ item.image.width }}" height="{{ item.image.height }}">
{% endif %}
</div>
<div class="event-content-wrapper">
<h3>{{ item.title }}</h3>
<div class="by-line">
<span class="display-date">{{ item.date|datetimeformat('%B %e, %Y') }}</span> |
<span class="location">{{ item.location }}</span>
</div>
<div class="event-description">
<br>
{{ item.description|truncatehtml(150,"...") }} <a href="{{ page_by_id(module.select_page).absolute_url }}#event-item-{{ loop.index }}" class="more-link">Read More</a>
</div>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% endfor %}
Comments
Post a Comment