calendar display

is it possible to have  the calendar display a single link called “events” on days when 1 or more events have been scheduled.

then clicking on the link would then lead to a list of links for the events scheduled on that day and each of those to the details for that individual link.

the list of links could actually be an accordion or something with the name of the event in the title and could expand to show the details.

I suppose that would work with two separate custom displays. The first would be the calendar and the second would be set to show all entries or "Both (dynamic)".

Custom display #1:
In the content box, add a link to the page holding custom display #2. The link will look something like [siteurl]/page-with-display?thedate=[25 format='Y-m-d']
Replace 25 with the ID of your date field.
Then, you'll need a bit of custom code so it's only shown once per day. In the "advanced" box, add a row to filter the entries for: Date field is not equal to _____ (leave the box blank). The custom code will add to this setting.
http://formidablepro.com/knowledgebase/frm_where_filter/#kb-only-show-unique

Custom display #2:
Set this display up however you'd like, and add a row to filter the entries in the "advanced" box:
Date field is equal to [get param=thedate]

Thanks Steph, do i add the custom code into my theme functions file?
and can i nest conditionals in a custom display, and if so how, i don't seem to be able to get it to work.

Yes. You can find a little more instruction here:
http://formidablepro.com/knowledgebase/formidable-hooks/

You can nest conditionals with:
[if 25][if 40]stuff here[/if 40][/if 25]

The structure is like html. The last one must be closed first.

Thanks, the nesting worked great.
The Calendar solution almost works.
The links between the displays works great and display 2 is working just like i needed.
The problem i'm having is in display 1.

The calendar is still displaying all events in the calendar on days with more than 1 event.
I've  set the advanced filter to the date field Not equal to blank and added the custom code to my theme's function file.

i set the 1st parameter in the code to the id of display 1 (the calendar, where the filter is set), and the 2nd to the id of the date field.

So I'm not really sure what to try next.

 

What is the exact code you are using? What version of Formidable are you running? Also, is this form creating posts?

Hi Steph,
i'm using Version 1.06.05 and no i'm not creating any posts.
the code as i have it in the functions file is as follows

add_filter('frm_where_filter', 'filter_custom_display', 10, 2);
function filter_custom_display($where, $args){
if(isset($args['display']) and $args['display']->id == 2 and $args['where_opt'] == 110){
$where .= " GROUP BY meta_value";
}
return $where;
}

 

It looks like it works differently with date fields. Use this instead:

add_filter('frm_where_filter', 'filter_custom_display', 10, 2);
function filter_custom_display($where, $args){
  if(isset($args['display']) and $args['display']->id == 2 and $args['where_opt'] == 110){
    $where = "fi.id='". $args['where_opt'] ."' GROUP BY meta_value";
  }
  return $where;
}

NICE.. That worked much better, and easier to see the intended results, getting so much closer.
it does exactly what i wanted by combining multiple events in a single day into one link on the calendar,

but now it doesn't display days that only have a single event scheduled..
btw, i truly appreciate your help.

This is working fine for me. Are you sure this is what's happening?

Hi Steph,

yeah, what's happening is when the form for creating an event is submitted, it is saved as an entry in the table, but unless there are multiple events for the same date, the calendar doesn't display an entry.

we verified by creating a new event, which did not display on the calendar, when we added another event for the same day,  the calendar displayed an entry.

so is there a way to have the calendar display an entry on a day when there is only a single entry that doesn't need to be grouped.

This is working that way for me. I'm not sure what to tell you.

Steph,

Here's what i did, i created a csv with event dates for all days in the year.

i imported it, set a conditional so that events with out a name don't display

then when displaying a calendar, they don't appear.

now whenever i add a new (real event) it shows up in the calendar because now there are technically two events for any given date.

The date format must be incorrect on the imported entries. When you go to edit one of those, does the date show correctly in the date field?

I got it working, (or it seems to be working), by changing the advanced setting to is greater than now..
new question, is it possible to have the calendar show up on dynamic individual pages based upon the id of the user that created it?

say i create an event and it displays on the calendar along with events posted by others, but when someone clicks on  a specific event they are taken to a page that shows only my events?

Sure. I think it'll work to add user_id=current in the custom display shortcode on the page for just the logged in user's events.

thanks i'll give it a shot..

Topic closed.