Info sessions macro
Import the macro
{% import "macros/info-sessions-feed.html" as info_session %}
Call the macro inside a bottom_js block
{% block bottom_js %}{{ parent() }}
{# The call to parent() above is *very* important #}
{{ info_session.info_sessions_feed_js("McNair") }}
{% endblock %}
The parameter we passed in above is the value for the code query parameter in the feed. I.e., https://apps.cehd.umn.edu/students/infosession/admin/RSSFeed.aspx?code=McNair
The macro accepts other parameters as well. See the table below.
Order | Parameter | Description | Default |
---|---|---|---|
first | code | The value for the code query parameter in the info sessions feed. I.e., https://apps.cehd.umn.edu/students/infosession/admin/RSSFeed.aspx?code=McNair | None (required) |
second | limit | The number of results to display | 4 |
third | target element selector | The JQuery selector for the element where info sesssion should be rendered | #info-sessions-container |
fourth | path to template | The path to the directory where the Nunjucks† template is | /assets/dist/views/cehd/info-sessions |
fifth | Nunjucks† template name | The name of the Nunjucks template used to render the events | index.html |
† Nunjucks is a JavaScript template engine that has a syntax almost identical to Twig.
Calling macro with all parameters
{% block bottom_js %}{{ parent() }}
{# The call to parent() above is *very* important #}
{{ info_session.info_sessions_feed_js(
"McNair",
2,
"#info-sessions-container",
"/assets/dist/views/cehd/info-sessions",
"special-template.html"
) }}
{% endblock %}