College of Education and Human Development wordmark.

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.

info_sessions_feed_js macro parameters
OrderParameterDescriptionDefault
firstcodeThe value for the code query parameter in the info sessions feed. I.e., https://apps.cehd.umn.edu/students/infosession/admin/RSSFeed.aspx?code=McNairNone (required)
secondlimitThe number of results to display4
thirdtarget element selectorThe JQuery selector for the element where info sesssion should be rendered#info-sessions-container
fourthpath to templateThe path to the directory where the Nunjucks† template is/assets/dist/views/cehd/info-sessions
fifthNunjucks template nameThe name of the Nunjucks template used to render the eventsindex.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 %}