I'd like a list of upcoming events in my site's sidebar. I'm trying site.upcoming_event_pages but I'm getting an error:
Liquid error: PGError: ERROR: missing FROM-clause entry for table "types"
LINE 1: ...= "pages".site_id WHERE ("pages".site_id = 1 AND (types.name...
Sam,
You would use the method described here to display content from one page on another.
In this example, the code in the partial template _events_latest.html would look something like this:
{% for event in page.calendar.events_upcoming limit:5 %}
{% include "event" %}
{% endfor %}
You would then place {% subpage “xx” with “events_latest” %} in the template, where you want the events to display. The xx corresponds to the calendar page slug.
If you send me a link to the page you are trying to edit I can help point you in the right direction.
UPDATE: If you are using the Aware theme, you can now display excerpts on your homepage simply by using the page tag homepage. This will display an event on your homepage, in addition to excerpts from other pages. You may want to try this as an option that does not require updating the code of your website. More information on featuring excerpts on your homepage is available.
Showing 45 reactions
Sign in with
Certified Agency
Certified Architect
Certified Expert
Certified Developer
Certified Agency
Certified Architect
Certified Expert
Certified Developer
You can pull through events with a specific tag by changing:
{% subpage “home” with “events_homepage” }
to:
{ tag “some_tag_slug” with “events_homepage” %}
You would also need to change the first line of your partial (based on Brad’s code below) from:
{% for event in page.calendar.events_upcoming limit:3 }
to:
{ for event in tag.most_recent_published_pages limit:3 %}
Everything else could stay the same :) Cheers!
Now: anyone know how to pull just events with a specific tag? Or maybe exclude events with a specific tag?
Act for America
Greg Evers for Congress
Marston Digital Solutions
Certified Architect
Certified Expert
Your liquid {% subpage “home” with “events_homepage” %} seems to be trying to pull events from the home page as opposed to the calendar page.
I’ve used this.
Place this where I want the events listed on the home page.
{% subpage “calendar” with “homepage_event” %}
And this is in my _homepage_event.html file. {% if page.headline.size > 0 %} <h2 class=“section-headline”><i class=“fa fa-calendar”></i> {{ page.headline }}</h2> {% endif %}
{% for event in page.calendar.events_upcoming limit:3 }
<h3><a href=“%7B%7B%20event.url%20%7D%7D”>{{ event.name }}</a></h3>
<div class=“page-excerpt”>
<div class=“event-info”>
{{ event.event.local_start_at | date: ‘%A, %B %d, %Y at %I:%M %p’ }}
{ if event.event.is_multi_day? }
through {{ event.event.local_end_at | event_date }}
{ endif }
{ if event.event.is_ticket_required? }
· {{ event.event.ticket_price_with_currency }}
{ elsif event.event.is_user_ticket_required? }
· {{ event.event.user_ticket_price_with_currency }}
{ endif }
{ if event.event.show_guests? and event.event.rsvps_count > 0 }
·
<a href=“%7B%7B%20event.url%20%7D%7D”>{{ event.event.rsvps_count }} rsvp{ if event.event.rsvps_count > 1 }s{ endif }</a>
{ endif %} {% if event.event.has_venue? %} <div class=“event-venue”> {% if event.event.has_venue_address? %} {{ event.event.venue_name }} in {{ event.event.venue_address.location }} {% else %} {{ event.event.venue_name }} {% endif %} </div> {% endif %}
</div> <div class=“padtop”></div>
<center>
{% if event.event.is_maximum_capacity? }
<a class=“btn btn-danger” href=“%7B%7B%20event.url%20%7D%7D”>Sold out</a>
{ elsif event.event.is_past? == false }
{ if event.event.is_ticket_required? }
<a class=“submit-link btn btn-danger” href=“%7B%7B%20event.url%20%7D%7D”>Buy tickets</a>
{ elsif event.event.accept_rsvps? }
<a class=“submit-link btn btn-danger” href=“%7B%7B%20event.url%20%7D%7D”>RSVP</a>
{ endif }</center>
{ endif %} </div> <hr> {% endfor %}
On my homepage, slug “home”, I’ve got this code:
{% subpage “home” with “events_homepage” %}
In the template events_homepage.html I’ve got this code:
{% for event in page.calendar.events_upcoming limit:3 %}
<div class=“homepage-cal-headline”><a href=“%E2%80%9C%7B%7B”>{{ event.headline }}</a></div>
<div class=““homepage-cal-date””>
{{ page.event.local_startat | date: ’%B d, %Y ’ }}
</div>
{ endfor %}
I tried it with just
{% include “event” %}
I also tried on the homepage:
<ul class=“event”>
{% for event in page.calendar.events_upcoming }
<li>{ include “event” }</li>
{ endfor %}
</ul>
in the template, and nothing showed up there, either. I’d ultimately like to show just events with a specific tag, which I don’t seem to see documentation on, either.
I have three upcoming events — they show up fine on the main calendar page.
Any help on what I’m missing much appreciated!
I had mistakenly assumed that the page variable would have to be event related.
http://nationbuilder.com/page_tag_variables
The first example, for calendar pages, does work because “events_upcoming” is a calendar page variable:
http://nationbuilder.com/calendar_page_variables
We recommend for the {% for event in tag.events_upcoming } you actually use: { for event in tag.most_recent_published_pages %}
An event set up with the tag ‘fossilfools’.
A custom html file called ‘_fossilfools_events.html’ with the following code:
<ul class=“event-wrap”>
{% for event in tag.events_upcoming }
<li>{ include “event” }</li>
{ endfor %}
</ul>
I’ve then included the following liquid code in the template of the page where I want to display all events that have the tag ‘fossilfools’: {% tag “fossilfools” with “fossilfools_events” %}
Nothing is displaying. I can only think that the theme object reference of ‘events_upcoming’ is the problem and needs to be substituted with a different theme object reference in order to work with tags. But there doesn’t seem to be any info about this.
Can anyone help? – it’s very frustrating, and I’m sure would be a very useful feature for lots of people.
The code listed in this answer works wonderfully, but if you want to change how the event excerpt is formatted (e.g. Display event name before the event date, change the color of the event name, etc…), you can edit all of this in the _event.html file. This file won’t show up in the files tab under Theme, but if you click “create new file” and name the new file _event.html, it will detect that a file with that name already exists and you will be able to edit it.
I create a new theme using the Aware theme base as you recommended. My home page is the About page, here is a excerpt of the code:
When I visit the About page after “save a publish” I can see the “Lorem” and the “Ipsum” paragraphs but nothing in the middle, not even the “ul.event-wrap”.
I have verify my events, and even visit the events page, and there are 3 of them. And my slug is “events” and not “calendar”, because when I use “calendar” the template complain about slug not be found. I also tried this with your blog post example and replace the “blog” slug with “news” because that’s what I have and it did not work.
Everything is just a silent error.
Please could you indicate me why this is not working and how can I solve it?
Thank you.</div></code>
But as the last poster I want to display only events with a certain tag.
I tried putting this in the page template that I want to display the calendar:
And this in the template _events_latest.html
but it doesnt work, any help?
Hines Digital
Certified Architect
Certified Expert
{% for event in page.calendar.events_upcoming limit:5 tag:community %}
But that didn’t work.
…and setting it to the href attribute in the link around the event title:
It might be a typo or a character encoding issue on our side, but it doesn’t seem like your full code is using {{ event.url }} to grab the event url?
Here is the full code from a partial called _calendar_latest.html:
atgmail. Cheers.) the code should be
– and again, i would double check that you are using the right quotation marks in your code.
-and again, i would double check that you are using the right quotation marks in your code.Heres my calendar_latest template code:
{% for event in page.calendar.events_upcoming limit:5 }
{ include “event” }
{ endfor %}
Heres the code i placed in the right column on my column_2 template:
<div class=“events”>
{% subpage “calendar” with “events_latest” %}
</div>
http://ambergivenscampaign.nationbuilder.com/
Act for America
Greg Evers for Congress
Marston Digital Solutions
Certified Architect
Certified Expert
Hines Digital
Certified Architect
Certified Expert
As for the event time, have you tried using the variables on this page? http://nationbuilder.com/event_page_variables
Status key