Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expandable inserts <ul> tags when list is small #2020

Open
GuillermoFidalgo opened this issue Aug 16, 2023 · 0 comments
Open

expandable inserts <ul> tags when list is small #2020

GuillermoFidalgo opened this issue Aug 16, 2023 · 0 comments

Comments

@GuillermoFidalgo
Copy link
Contributor

I wanted to reuse the code

{% include get_all_events.html %}
{% assign sorted_events = all_events | sort: 'startdate' | reverse %}
{% assign training_events = "" | split: "," %}
{% for event in sorted_events %}
{% if event.labels %}
{% if event.labels contains "outreach" %}
{% assign training_events = training_events | push: event %}
{% endif %}
{% endif %}
{% endfor %}

{% expandable training_events 7 %}
{% include print_event.html students=1 event=expandable %}
{% endexpandable %}

on the newly renamed "outreach" page proposed in #2019 but I noticed when testing that if the interger argument for this line {% expandable training_events 7 %} is greater than the number of elements available (i.e we have only 2 events in the array training_events but I ask for 7 before the "Show More" box appears) then it renders
some unordered lists tags on the page.

This is not a big deal as eventually the array will contain more events, or I could simply make the number smaller for now. But it would nice for those tags to not render when we have few events to list.

@GuillermoFidalgo GuillermoFidalgo changed the title include expandable inserts <ul> tags when list is less than given expandable inserts <ul> tags when list is less than given Aug 16, 2023
@GuillermoFidalgo GuillermoFidalgo changed the title expandable inserts <ul> tags when list is less than given expandable inserts <ul> tags when list is small Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant