You might be able to use a Date field here which comes with a day pickers but it’s sometimes a pain to enter really old dates.
What I’d look at doing is using 3 custom fields, one each for day, month and year. You could then query any day/month/year combination including just day & month (any year). You could extend that by adding another field for the actual day (Mon, Tue , Wed etc) for even more possibilities, you could even add another field for the time of day the event happened so you could show events that occured at midnight!
There are many ways of doing this, here’s a couple of examples. I’m using month values as 01 to 12 and day values as 01 to 31 .
This method might work best of you want it in a sidebar or footer.
Here we’re calling a regular channel entries loop for your “my_events” channel. Note how we’re using search: parameters with current_time variables to call in the current month and day.
{exp:channel:entries channel="my_events" search:my_month_field="{current_time format='%m'}"
search:my_day_field="{current_time format='%d'}" dynamic="no"}
{title} happend on this day
{/exp:channel:entries}
This method is great if you have, say, a news story and want to show something for the same day/month that the story was posted.
Create a template for embedding, in that template add your events entries tag:
{exp:channel:entries channel="my_events" search:my_month_field="{embed:the_month}"
search:my_day_field="{embed:the_day}" dynamic="no}
{title} happend on this day
{/exp:channel:entries}</code></pre>
Note how we're using search: parameters here with embed: values.
Now call the embed template inside your news tag:
<pre><code>{exp:channel:entries channel="news" limit="1"}
{title}
{embed="template_group/template" the_month="{entry_date format='%m'}" the_day="{entry_date format='%d'}"}
{/exp:channel:entries}
What we’re doing here is using the entry_date of the news story to get month and day values.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.