ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Question about calendar

February 24, 2008 6:42pm

Subscribe [4]
  • #1 / Feb 24, 2008 6:42pm

    jared351

    22 posts

    I’m going to be using this method for a simple events calendar, and about 10 upcoming events will be called into the index. My question is, when I display all the events on the actual events page, Is there any way I could have it formatted like this where the events are listed in list mode, but you can switch back between months like a regular calendar. You will have to check out the link to probably get a closer look at what I’m wanting. Thanks for any and all help and guidance.  😉

  • #2 / Feb 24, 2008 7:04pm

    Sue Crocker

    26054 posts

    jared351, you certainly could make the calendar look like what you’ve linked to.

    Disclaimer: Now I didn’t look very carefully at your first link, but spent more time on the second link and their site.

    I need to do something similar for our church site.

  • #3 / Feb 25, 2008 3:40pm

    jared351

    22 posts

    Thanks for the reply Sue. Trying to logically think this out, on the actual events page I would call the blog like this I’m assuming

    {exp:weblog:entries weblog="event_calendar" orderby="date" limit="" show_future_entries="yes" start_on="<?php echo $current_time; ?>"}
    <span class="eventsTitle"><a href="#">{title} at {time}</a></span>
    
    <span class="eventsLocation">{location}</span>
    
    {body}
    {/exp:weblog:entries}

    And then as far as getting to switch back and forward between the different months, I really don’t have a clue as what tags to use to make that happen.

  • #4 / Feb 26, 2008 3:01pm

    jared351

    22 posts

    Anybody know how to get that functionality?

  • #5 / Feb 26, 2008 3:09pm

    Lisa Wess

    20502 posts

    Use the calendar tag’s month links, that’s the easiest way. =)

  • #6 / Feb 26, 2008 3:11pm

    jared351

    22 posts

    Thanks for the reply Lisa! I will try that out.

  • #7 / Mar 04, 2008 3:02pm

    jared351

    22 posts

    Stepped away from the project for a little bit, but I’m finally back to it. I have got the front end part of the events page working pretty good, the only thing I’m having trouble with is the dynamics as far as previous month, next month, and then getting the month and year to change when the month links are clicked on. This is the code I am using. I think I might have the wrong calendar tags.

    <div class="calendarNav"><a href="http://{previous_path=weblog/events_calendar}" class="monthPrevious">Previous Month</a><a href="http://{next_path=weblog/events_calendar}" class="monthNext">Next Month</a><h1>{date format="%F %Y"}</h1></div>
    {exp:weblog:entries weblog="events_calendar" orderby="date" limit="" show_future_entries="yes" start_on="<?php echo $current_time; ?>"}
    <ul id="eventList">
    <li>
    <h2>{title} - {event_date}</h2>
    <p><dl class="calendarEvents"><br />
    <dt><b>Time:</b> {time}</dt><br />
    <dt><b>Where:</b> {loc}</dt><br />
    <dt><b>Details:</b> {event_body}</dt><br />
    </dl><br />
    </li><br />
    </ul><br />
    {/exp:weblog:entries}

    I would appreciate any and all help! Thanks!

  • #8 / Mar 05, 2008 3:40am

    jared351

    22 posts

    Anybody have an idea on the tags I should be using?

  • #9 / Mar 05, 2008 2:43pm

    Lisa Wess

    20502 posts

    For the previous and next month tags, you’ve pulled out the parts from the calendar docs it looks like, but you need them surrounded in the calendar tag.

    Try something like this:

    {exp:weblog:calendar}
    <a href="http://{previous_path=weblog/index}">previous</a>
    
    <a href="http://{next_path=weblog/index}">next</a>
    {/exp:weblog:calendar}
  • #10 / Mar 05, 2008 3:02pm

    jared351

    22 posts

    Oh. That makes sense. Now as far as the path goes “weblog/index” do I need to change that to the name where my events page resides? Also how do I get lets say “Feburary 2008” to be displayed dynamically when your switching back and forth between next and previous months? I appreciate your help.

  • #11 / Mar 05, 2008 3:16pm

    Lisa Wess

    20502 posts

    Yes, you’ll want it to point to the appropriate template_group/template_name. =)  Check out the calendar tag, there is a variable for that date display as well. =)

  • #12 / Mar 05, 2008 7:12pm

    jared351

    22 posts

    K I got it all working beautifully thanks to your help. One last question for you or anyone else. I have a certain amount of events in my sidebar, and I want their titles to be clickable and linked to their specific entry rather than the whole month of events, so is their a tag I can use for that functionality. Its probably something really easy I don’t see. 😉 Thanks.

  • #13 / Mar 05, 2008 7:44pm

    Lisa Wess

    20502 posts

    Sure, do a search for comment_url_title_auto_path in the docs - here’s a hint:

    <a href="http://{comment_url_title_auto_path}">{title}</a>

    inside the weblog entries tag, of course. =)

  • #14 / Mar 05, 2008 9:03pm

    jared351

    22 posts

    Your awesome Lisa! Thanks for all the help!

  • #15 / Aug 07, 2008 12:34pm

    Ed Hebert

    49 posts

    Thanks to you both, I have my calender formatted like yours and working perfectly. 

    However, this newbie has one stupid question about linking to the current calendar month from the homepage.

    I see how (previous_path=”..”} and {next_path=".."} work with the calendar tag to retrieve the previous and next month’s data accordingly.  there’s not “current_path” or similar.

    What is the correct tag to construct a link to send a user to the current month?  e.g.  “..events/list/2008/08/” (as we’re in August 2008 as I write this)

    I looked at the docs for the calendar tag, and I don’t see anything that would act to append the current month/year onto the template path as it does for previous/next.

    Thanks in advance

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases