Monthly Calendar || Month View So I have /calendar and linking previous/next months on that template. The previous/next month urls are /calendar/2015-08 and /calendar/2015-08.

I have this custom route setup:



On my /calendar/2015-08 I'm getting this:

Variable "entry" does not exist

Part of my template looks like:

{% extends '_inc/_layout' %}

{% block meta %}
&lt;title&gt;{% if entry.metaTitle|length %}{{ entry.metaTitle }}{% else %}{{ entry.title }}{% endif %}&lt;/title&gt;
&lt;meta name="description" content="{{ entry.metaDescription }}" /&gt;
&lt;meta name="keywords" content="{{ entry.metaKeywords }}" /&gt;
{% endblock %}


I know why this happening but my question is how do I circumvent this? I want some of the same data on /calendar to be on subsequent monthly calendar pages.

Thanks in advance!
Craft won't set the entry variable automatically unless the route matches a particular entry. If you're sharing a template between routes that may or may not correspond to an entry, you need to make sure that var gets set explicitly by you if not automatically by Craft:

{% if entry is not defined %}
    {% set entry = craft.entries.section('myStructure').slug('calendar').first %}
{% endif %}