0

I'm working with SolSpace Calendar and I'm having trouble getting my styles to correctly display when paths are used in Calendar.

The calendar page is here: http://www.clubomgsf.com/calendar

For example: in the month view of the calendar, the "previous" and "next month" links look like this:

{path='calendar/month'}/{next_month format="%Y/%m"}/ which ends up looking like this: http://clubomgsf.com/calendar/2014/10/

It looks like additional subdirectories are being called, but they don't exist. I know this is some sort of templating question, but I've looked around in the doumentation and can't seem to find an explanation of how this works.

Question 1: How is Solspace Calendar using these "subdirectories" (e.g. calendar/2014/10/ ) to pass these variables through to the next page?

Question 2: Currently I am using a snippet to link to global CSS document. What is the best way to get this styling to pass through to pages being called by "subdirectories" as mentioned above?

I appreciate your help.

EDIT: My MONTH template:

    <!doctype html>
<html>
<head>
<meta charset="UTF-8">
{exp:channel:entries channel="static_information"}
    <title>{website_name}</title>
    {site-includes}
{/exp:channel:entries}

</head>
<body>


<div id="background"></div>











<div id="masthead">
    {exp:channel:entries channel="static_information"}

    <a href="{site_url}mainsite"><img id="logo" src="{logo}" /></a><br />
    <div id="contact-info">
        {phone_number}<br />
        {address}<br />
        {e_mail}
    </div>

    <div id="sinker-left">
    </div>

    {/exp:channel:entries}
</div>











<div id="content-wrapper">







    <div id="content">  


        {exp:channel:entries channel="static_information"}
<a href="{site_url}mainsite"><div class="mobile-logo"><img src="{logo}" /></div></a>
{/exp:channel:entries}






        <div class="calendar-wrapper">




        <div id="fc_calendar">
            {exp:calendar:cal
            {if segment_3 == ''}
                date_range_start="year-month-01"
                date_range_end="year-month-last"
            {/if}
            {if segment_3 != ""}
                date_range_start="{segment_3}-{segment_4}-01"
                date_range_end="{segment_3}-{segment_4}-last"
            {/if}
            }
            {display_each_month}


            <thead>
            <div class="floatleft"><a href="{path='calendar/month'}/{prev_month format="%Y/%m"}/">{prev_month format="%F"}</a></div>
            <div class="cal-header">{date format="%F %Y"}</div>
            <div class="floatright"><a href="{path='calendar/month'}/{next_month format="%Y/%m"}/">{next_month format="%F"}</a></div>            
            </thead>





                <table id="fc_outer">

                <tbody>
                    <tr>
                        <td colspan="7">
                            <div class="wrap">
                                <table id="fc_inner">
                                    <thead>
                                        <tr id="days_of_week">
                                            {display_each_day_of_week}
                                            <th class="day_of_week {day_of_week}">
                                                {day_of_week}
                                            </th>
                                            {/display_each_day_of_week}
                                        </tr>
                                    </thead>
                                    <tbody>
                                        {display_each_week}
                                         <tr>
                                            {display_each_day}
                                            {if day_in_current_month}
                                                <td class="day_cell">
                                                    <div class="date">
                                                        <a class="num"
                                                            href="{path='calendar/day'}/{date format="%Y/%m/%d"}/">
                                                            <div class="fp-cal">{date format="%j"}</div>  <!-- Dates in current month -->
                                                        </a>
                                                    </div>
                                            {if:else}
                                                <td class="day_cell out_of_range">
                                                    <div class="date">
                                                    <span class="num">
                                                        <div class="fp-cal-nonmonth">{date format="%j"}</div>  <!-- Dates in non-current months -->
                                                    </span>
                                                </div>
                                            {/if}
                                            {display_each_hour}
                                                {events}
                                                    <div
                                                      class="
                                                        event {if event_all_day}all_day{/if}
                                                        {if event_multi_day}multi_day{/if}
                                                        {if event_first_day}first_day{/if}
                                                        {if event_last_day}last_day{/if}
                                                        {if all_day_event_index_difference > 0}
                                                            index_difference_{all_day_event_index_difference}
                                                        {/if}
                                                      ">



                                                        <div class="c-eventbutton" style="background-image:url('{event_image}')">
                                                            <div class="c-infospacer">
                                                                <div class="c-eventinfo">
                                                                    {event_title}<br />
                                                                    {event_start_date format="%g%a"} • 
                                                                    {if price}${price}{if:else}Free{/if}
                                                                </div>
                                                            </div>
                                                        </div>




                                                    </div>
                                                    {/events}
                                                {/display_each_hour}
                                            </td>
                                            {/display_each_day}
                                        </tr>
                                        {/display_each_week}
                                    </tbody>
                                </table>
                            </div>
                        </td>
                    </tr>
                </tbody>
            </table>
            {/display_each_month}
            {/exp:calendar:cal}
        </div>




        SEGMENTS:<br />
1: {segment_1}<br />
2: {segment_2}<br />
3: {segment_3}<br />
4: {segment_4}<br />
5: {segment_5}<br /><br />







        </div>
    </div> 
</div>









{embed="mainsite/sidebar-tpl"}



</body>
</html>
  • What version of EE and Calendar are you using? Please provide exact version numbers. Also, can you edit the above question to include your Calendar template code? Finally, calendar/2014/10/ isn't a subdirectory: You might have a template group called calendar and a template called index, which gives /calendar. The /2014/10 part is interpreted by the calendar/index template which, if well coded, pulls data for Oct. 2014. – Solspace Nov 24 '14 at 7:25
  • The EE version that I am using is 2.7. I understand that this is a path variable, but I'm not sure why the styles aren't being transferred properly. I must be missing something here. Do you happen to have a collection of barebones templates for Calendar that illustrates the interaction between the various features of Calendar? E.g.: Month view, week view, day view, etc. The trouble I seem to be having is that templates style information doesn't work if the URL contains these path variables, suggested by the Calendar module (calendar/2014/10/). Definitely flummoxed at this point. :/ – Paredes Creative Nov 24 '14 at 20:06
  • Calendar comes with Demo Templates, which install themselves like regular templates in EE. These contain a number of example template code and showcase some of the features of Calendar. You can find the Demo Template installer from the Calendar module under "Demo Templates". – Solspace Nov 25 '14 at 14:01
  • Ok so here's the issue. I have a templates that are pretty simple that should display months and days properly. || Take a look the calendar template: clubomgsf.com/calendar || Now if I use the syntax to bring up November specifically, it looks great: clubomgsf.com/calendar/month/2014/11 || But if I choose any other month, everything breaks down and I can't figure out why. clubomgsf.com/calendar/month/2014/12 (December) – Paredes Creative Nov 26 '14 at 21:52
  • It seems like any {exp:channel:entries} tags that are in these templates are completely ignored but the {exp:calendar:cal} tags are processed just fine. I'm extremely confused by this behavior and I don't really even know where to start to remedy this situation. Have you seen this before? – Paredes Creative Nov 26 '14 at 22:05
1

Ok everyone. I've figured this out.

If you are using segment variables like SolSpace Calendar does, please be sure to add dynamic="no" to your {exp:channel:entries} tags since the segment variables are designed to be used by the Calendar module.

In my case, Calendar's segment variables were mucking up other things that were supposed to be happening without being affected by these variables. This was happening even though I was NOT using any {segment_#} tags in any of my {exp:channel:entries} tags, which seems quite counterintuitive. Just keep an eye out.

Whew!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.