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.

Weblog entries and calendar module

September 22, 2008 3:53pm

Subscribe [2]
  • #1 / Sep 22, 2008 3:53pm

    stephen-wilson

    16 posts

    Hi everyone,

    I was wondering if someone might point me in the right direction regards the following problem:

    The site I am setting up isn’t technically a blog-style site. I have several entries which list up-and-coming events. I want to display these events using the calendar module however, because these events need to be visible from today’s date onwards I have specified the 22nd Sept as the entry date. Unfortunately, this means the calendar module is currently listing all the items under the 22nd. Is there a way to force the calendar to display each item based on a custom weblog field in this instance {social_date} or perhaps there is another way?

    Any help would be greatly appreciated,

    Steve

  • #2 / Sep 22, 2008 4:06pm

    Greg Aker

    6022 posts

    Steve:

    How about making the entry date the actual day of the event, and then show_future_entries=“yes” in your calendar tag pair?

    -greg

  • #3 / Sep 22, 2008 4:12pm

    stephen-wilson

    16 posts

    Hi Greg,

    I have setup show future events but having thought about this I think the problem lies more with my weblog entries that the calendar module! To solve the problem I’m assuming I would need make EE display weblog entries date-stamped in the future - is this possible?

    S

  • #4 / Sep 22, 2008 4:27pm

    Greg Aker

    6022 posts

    Steve:

    Absolutely.  The same parameter is available withing the weblog entries tags.  See this page in the docs.

    -greg

  • #5 / Sep 22, 2008 4:38pm

    stephen-wilson

    16 posts

    Thanks so much Greg… Just what I needed!

    I have one more question if I may!

    The calendar module uses the following code to link to an item: {title}

    How would I go about linking to my weblog template - in this instance ‘social’ and display this item as a single entry?

    S

  • #6 / Sep 23, 2008 10:45am

    stephen-wilson

    16 posts

    Hi, I’m not sure whether to bump this thread because the previous problem was solved but I have another query that I’m not sure about. Any help would be appreciated.

    If you visit http://www.acceleratorhq.com/cjl/index.php/about you’ll see I’ve setup a calendar. However, when you click the << and >> links to browse through the months you’ll notice that the information in the left hand column disappears. The current code I’m using is << and >> respectively.

    How would I fix this problem?

    Thanks,

    Steve

  • #7 / Sep 23, 2008 11:19am

    Robin Sowell

    13255 posts

    It’s because when you click <<>> it changes the url and the weblog tag providing content for that left content area tries to serve up dynamic content that matches the url.  If there isn’t any- it’s blank. 

    Two ways to approach it- use the dynamic=“off” parameter in that left weblog tag.  That causes it to ignore any info passed in the url.  Or- take them to a different page entirely when the surf months.  (Well- could get fancy w/some ajax or an iframe or something.)

    Make sense?  Oh- and are you squared away on the linking issue?  It looked like it, but I wanted to make sure.

  • #8 / Sep 23, 2008 11:42am

    stephen-wilson

    16 posts

    Thank you so much Robin… Worked like a charm! Nothing fancy think I’ll just stick with the dynamic tag!

    Regards the links, I have sort of got it working. At the moment I’m using {day_number}. However, this will only link through to and display events that are social. I have two other template groups: learning and business - is there a way to change the {title_permalink="social"} tag so it links through to the correct template group depending on the event?

    S

    EDIT: An example of this not working is 10.06.08 - this is a learning not a social event.

  • #9 / Sep 23, 2008 11:55am

    Robin Sowell

    13255 posts

    Hm- well, it’s easy.  Try the {comment_auto_path} for example (inside the {entries} tag pair).  That will base the url on a per weblog setting.

    The only issue- keep in mind, if you have two entries on a day, the day number will show up twice.  So- what I usually would do is show the title.  Not an option on the small calendar.  On the small calendar, I would be tempted to have a special calendar page that can show multiple entries from any relevant weblog, link to it via the number using the {day_path=weblog/index}.  That generates a url to pull back entries on that day.  On my ‘multi-entry’ day page, I show all ‘stuff’ on that day from whatever weblogs.  Then THOSE link to the single entry pages- using a {comment_auto_path} type variable which will take them different places depending on weblog.

    Have I know confused you totally?  Basically- with the small calendar- I have the day number link to a multi-entry page showing everything for that day.

  • #10 / Sep 23, 2008 12:10pm

    stephen-wilson

    16 posts

    Erm, slightly confused! Sorry, I do try and work things through myself but this is proving a tough one!

    I’m now using {day_number} - using this code I’m getting the following: 26

    Not quite sure where to go next! Incidentally. this is a large calendar - I’ve just scaled it down because there will never be a physical calendar page (if that makes sense!).

    S

  • #11 / Sep 23, 2008 12:38pm

    Robin Sowell

    13255 posts

    Do me this- paste the whole tag real quick.

  • #12 / Sep 23, 2008 12:43pm

    stephen-wilson

    16 posts

    {exp:weblog:calendar switch="calendarToday|calendarCell" weblog="social|learning|business" show_future_entries="yes"}
            <table border="0" cellpadding="0" cellspacing="0" class="calendar">
              <tr class="calendarheader">
                <th class="calendarmonthlink"><a href="http://{previous_path=about}"><<</a></th>
                <th colspan="5" class="calendarmonth">{date format="%F %Y"}</th>
                <th class="calendarmonthlink"><a href="http://{next_path=about}">>></a></th>
              </tr>
              <tr>{calendar_heading}
                <td class="calendarday">{lang:weekday_abrev}</td>
                {/calendar_heading}</tr>
              {calendar_rows }
              {row_start}
              <tr>{/row_start}
                {if entries}
                <td align="center" class="{switch}">{entries}
                  <div><a href="http://{comment_auto_path}">{day_number}</a></div>
                  {/entries}</td>
                {/if}
                {if not_entries}
                <td align="center" class="{switch}">{day_number}</td>
                {/if}
                {if blank}
                <td align="center" class="calendarblank">{day_number}</td>
                {/if}
                {row_end}</tr>
              {/row_end}
              {/calendar_rows}
            </table>
            {/exp:weblog:calendar}
  • #13 / Sep 23, 2008 1:03pm

    Robin Sowell

    13255 posts

    OK- keep in mind, if you have two entries on the same day?  It will show a {day_number} for EACH entry.  The {entries} tag pair loops.  IF that’s what you want, I believe the above should work.  But- you need to make sure that for each weblog, you have a comment path specified.  So- go to ‘Admin- Weblog Admin- Weblog Management’- edit the relevant weblogs and look in ‘Paths’.  That’s where you specify it.  Should basically be the url to the single entry page for that weblog- and when used by {comment_url_title_auto_path} it will take that url and just stick the url_title on the end of it.

    NOTE- I screwed you up, because it should be {comment_url_title_auto_path} instead of {comment_auto_path} (which doesn’t stick the url_title on the end).

    OK- does that bit make sense?

    But like I say- IF you have two entries on the same day, it’s going to look a little weird.  Which is why I usually make the {day_number} link to a multi-entry page that shows ALL entries for that day, rather than going to a single entry page.  So:

    {calendar_rows }
    {row_start}<tr>{/row_start}
    
    {if entries}
    <td class='{switch}' align='center'><a href="http://{day_path=site/events}">{day_number}</a></td>
    {/if}
    
    {if not_entries}
    <td class='{switch}' align='center'>{day_number}</td>
    {/if}

    And on site/events I’d have a weblog that pulls from all weblogs that are included in the calendar.

    Just- different ways of going at it.  I just wanted to be sure you ‘get’ what happens if there are two entries on a single day.

  • #14 / Sep 23, 2008 1:19pm

    stephen-wilson

    16 posts

    Thanks Robin, all working!

    Yes, makes sense regards the entries tab looping… So essentially what you’re saying is setup an additional template called for example events, use the code you’ve provided and redirect to this page where two or more weblog entries can be listed chronologically?

    Once again, thanks for your help on this.

    S

  • #15 / Sep 23, 2008 1:24pm

    Robin Sowell

    13255 posts

    That’s how I’d do it if there’s any likelihood you’ll have more than one entry on a single date.  Otherwise, the calendar is going to look kind of odd with the doubled numbers.  It’s not required you do it that way or anything, though.  More- just be aware of how it will work.

    Cool?

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

ExpressionEngine News!

#eecms, #events, #releases