Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#796 2012-02-21 21:29:29

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: smd_calendar: complete schedule / event / calendar / diary

Thank you very much. So I’ll decide between my current solution and one with a custom field. The two article solution I don’t like particularly.

Thank you again for your great support for Textpattern and his users.

Offline

#797 2012-02-21 22:56:37

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: smd_calendar: complete schedule / event / calendar / diary

The datefields="custom_X,custom_Y" solution don’t work for a one day event. If I use datefields="custom_6,custom_6" then the calendar displays no event. I opted my first version without the RSS feed.

Another idea would be with a spanned event between the post date and the expires date. How could I prevent the “multifirst” and “multi” output and show only “multilast”?

Offline

#798 2012-02-21 23:06:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,494
Website GitHub

Re: smd_calendar: complete schedule / event / calendar / diary

GugUser wrote:

If I use datefields="custom_6,custom_6"

If you tell the plugin that the start date (bear in mind the ‘time’ part of the date will be set to midnight) is exactly the same date+time as the end date then the calendar will not show it. If you’re using expiry, datefields must (currently) be a discrete pair of fields.

If you use the same custom field, what you are effectively saying is this:

  • My event starts on 21 Feb 2012 at 00:00:00
  • My event ends on 21 Feb 2012 at 00:00:00

Thus, there is “no time” between the two dates and the event does not show.

How could I prevent the “multifirst” and “multi” output and show only “multilast”?

Sorry, I’m not sure I understand what you’re trying to achieve. The flags are just notifications and classes assigned to events/cells so you can perform conditional logic and style things accordingly.

A spanned event is one that has more than 24 hours between its start and end dates. It might be one second more than 24 hours, but it needs to exceed 86400 seconds to qualify as a spanned event.

Last edited by Bloke (2012-02-21 23:07:05)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#799 2012-02-21 23:56:52

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: smd_calendar: complete schedule / event / calendar / diary

A spanned event is one that has more than 24 hours between its start and end dates. It might be one second more than 24 hours, but it needs to exceed 86400 seconds to qualify as a spanned event.

Excuse me if I was not clear enough. With “spanned event” I wanted to write from a different option using the posted date (21 Feb) and the expires date (29 Feb) from the article. In this version, the calendar shows all fields between the 21 and 29 as event. But I just want the 29 (multilast) styled and linked as event. The styling is easy to change, but I would not link to the article in “multifirst” and “multi” flagged fields. For that reason I asked how can I prevent the output of the links in “multifirst” and “multi”.

Sorry, my English is not good. I hope I have now better explained the idea.

Offline

#800 2012-02-22 00:34:26

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,494
Website GitHub

Re: smd_calendar: complete schedule / event / calendar / diary

GugUser wrote:

how can I prevent the output of the links in “multifirst” and “multi”.

You’ll need to build your own cells using cellform. Maybe something like this:

<txp:smd_calendar size="small" firstday="1" id="cal-events"
     section="events" expired="0" cellform="calendar-cells" classlevels="cellplus" />

And in Form calendar-cells:

<txp:smd_if_cal flag="multilast">
   <h4>{events}</h4>
<txp:else />
   <h4>{day}</h4>
</txp:smd_if_cal>

That’s not perfect but it’ll only display an event link on the last day of multi-spanned events.

Last edited by Bloke (2012-02-22 00:34:56)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#801 2012-02-22 01:36:09

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: smd_calendar: complete schedule / event / calendar / diary

This ist great, it works! Even with two events. Many thanks.

The interesting part of the calendar code is:

<tr>
	<td><h4>20</h4></td>
	<td class="smd_cal_event smd_cal_multifirst"><h4>21</h4></td>
	<td class="smd_cal_event smd_cal_today smd_cal_multi"><h4>22</h4></td>
	<td class="smd_cal_event smd_cal_multi"><h4>23</h4></td>
	<td class="smd_cal_event smd_cal_multi"><h4>24</h4></td>
	<td class="smd_cal_event smd_cal_multi"><h4>25</h4></td>
	<td class="smd_cal_event smd_cal_multi"><h4>26</h4></td>
</tr>
<tr>
	<td class="smd_cal_event smd_cal_multilast"><h4><span><a href="/?date=2012-02-21&s=events">27</a></span></h4></td>
	<td class="smd_cal_event smd_cal_multi"><h4>28</h4></td>
	<td class="smd_cal_event smd_cal_multilast"><h4><span><a href="/?date=2012-02-22&s=events">29</a></span></h4></td>
	<td class="smd_cal_empty">&nbsp;</td>
	<td class="smd_cal_empty">&nbsp;</td>
	<td class="smd_cal_empty">&nbsp;</td>
	<td class="smd_cal_empty">&nbsp;</td>
</tr>

So I can style .smd_cal_multilast.

Offline

#802 2012-02-27 20:42:30

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_calendar: complete schedule / event / calendar / diary

hello stef, hello forum,

i’m currently planning the website for a major arts festival with about 90 exhibitions in three month. i would like to use textpattern together with smd_calendar plugin for this.

i’ve started with a section “exhibitions” on which i list my events with <txp:smd_article_event section="exhibitions" /> – works fine. but i would like to filter the eventlist and this where i stuck. this is the filtering i would like to establish:

a select list for filtering the events with the following features:

  1. show all events that start today
  2. show all events that finish in one week
  3. clear the list and return to display all events

i’ve read very carefully through the advise stef gave teemu in this forum post, but was seeking for a solution without custom fields (to ease my clients life). following the advise, i set up a form with <option value="<txp:smd_cal_now format="%Y-%m-%d" offset="1 week" />">Eine Woche voraus</option>. this indeed gave me the date i wanted (today + one week) in a variable “date”. i plugged this returning variable via adi_gps into smd_article_event: <txp:smd_article_event section="exhibitions" to='<txp:variable name="date" />'>. but this lead to nothing as both tag attributes (from and to) only accept “posted” but not “expires”.

so, this is my question: what would be the best way to set up such a filtering? ain’t there no solution without custom fields? do i overlook something very obvious and easy?

as you might see from this post, i have very, very limited coding and php skills. so i apologize if this seems to be a silly question.

thanks in advance for pointing me in the right direction, christoph

Offline

#803 2012-05-16 17:08:32

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Totoff, did you ever find a solution to your question about filtering?

Offline

#804 2012-05-16 17:18:50

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

Re: smd_calendar: complete schedule / event / calendar / diary

hi fotonomad,

yes and no. i found a solution without smd_calendar that displays information on how long an exhibition will run or – if so – says that it is already expired.

inside article_custom i use:

<div class="four columns omega exlist column_2">
  <txp:if_expired>
    <p class="expired">Leider bereits vorbei.</p>
    <txp:else />
    <txp:uli_if_expires_in days="07" hours="00" minutes="00">
      <p>Nur noch bis <b class="expires"><txp:expires format="%d.%m." /></b></p>
      <txp:else />
      <p><b><txp:posted format="%d.%m." />&ensp;bis&ensp;<txp:expires format="%d.%m." /></b></p>
    </txp:uli_if_expires_in>
  </txp:if_expired>
  <p><txp:custom_field name="Galerie" /></p>      
</div> <!-- exlist column 3 -->

i think i could develop this further to a navigation as i originally indented, but i got occupied by other jobs and haven’t followed this route.

you can see this code live on a page that is still under development: http://dev.photoszene-koeln.de/ausstellungen/

hope that helps!

p.s. thanks to uli who has contributed uli_if_expires

Offline

#805 2012-06-08 05:10:44

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: smd_calendar: complete schedule / event / calendar / diary

I’ve got a really strange problem with smd_calendar…. having never used it before, its pretty confusing :)

This is my tag

<txp:smd_calendar size="small" dayformat="{Su,Mo,Tu,We,Th,Fr,Sa}" />

But when this is output – every day is a link and every date is “?date=2012-04-24” – so all the links are the same.

Yet when I install on another site, its only the days where articles have been posted which are links, and they are links to the correct dates.

I know that I need to set this up with a start date and expire date…. but how come every link is the same date?

Offline

#806 2012-06-12 01:29:22

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: smd_calendar: complete schedule / event / calendar / diary

OK – now I’m getting somewhere…. this is something to do with article expiry date

Offline

#807 2012-06-22 15:36:28

Angelic Relic
New Member
From: Willits, California
Registered: 2012-01-01
Posts: 6
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Ok I am just a little overwhelmed and can not find an answer.
I need the start date to not be the posted date . . . . and I am not realy sure just where to begin
read and read and got myself more confused.

easy enough to set up a custom field but not sure how to use it to make the small calendar
post an event start date

if i set the posted date to the start date of the event then the article is not viewable till that date

aargh!!

Offline

#808 2012-06-30 23:26:11

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: smd_calendar: complete schedule / event / calendar / diary

What’s the best way of handling arbitrary dates? Is it possible just feed smd_cal a list of timestamps? I’m doing a theatre site and I was thinking I would provide a date/time picker and a custom field.

Still trying to wrap my mind around handling dates AND times AND multiple events with a datepicker, best candidate is this picker width some mechanism to let me inject more than one date into the field kinda like jmd_image_select and use a delimiter.

I’m going to have to support easy entry of date/times like this bad boy…

  • Friday August 3rd at 7:30 pm
  • Saturday August 4th at 7:30 pm
  • Friday August 10th at 7:30 pm
  • Saturday August 11th at 2:00 pm
  • Sunday August 12th at 7:30 pm
  • Wednesday August 15th at 7:30 pm
  • Friday August 17th at 7:30 pm
  • Saturday August 18th at 2:00 pm
  • Sunday August 19th at 7:30 pm
  • Tuesday August 21st at 7:30 pm
  • Thursday August 23rd at 7:30 pm
  • Saturday August 25th at 7:30 pm
  • Sunday August 26th at 2:00 pm

Anyone else done a venue that requires multiple dates. Any thoughts, appreciated?

Offline

#809 2012-07-01 21:45:51

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,494
Website GitHub

Re: smd_calendar: complete schedule / event / calendar / diary

mrdale wrote:

Anyone else done a venue that requires multiple dates. Any thoughts, appreciated?

If you can track him down, istr woof wrote a theatre type site and it was for him that I added the extra, omit and datefields features.

Since the performance of the show is generally the same duration, my initial thought was to use:

  • Txp Posted date = start of performance (e.g. 2012-08-03 19:30:00).
  • Txp Expires date = end of performance (e.g. 2012-08-03 23:00:00).
  • Use combinations of stepfield, extrafield and/or omitfield to program repeat performances. You can use date ranges in the latter two, e.g. 2012-08-04, 2012-08-10 => 2012-08-12.

The sticking points are the fact that the times change without any real pattern to them (some Saturday afternoons, some Sunday), and you need some way to input the data visually.

Whichever way you slice it, the UX is horrible. I mean, even if you completely ignore smd_calendar and custom fields for a moment, what would the ideal workflow be for users?

  1. Put in performance #1 details, including start/end times of the show
  2. Click ‘add date’ which pops up a calendar, defaulting to, I dunno, next day at the same time
  3. Adjust date and time accordingly.
  4. Cilck OK.
  5. Repeat from step 2
  6. Save

Seems clunky to me. Or:

  1. Put in performance #1 details, including start/end times of the show
  2. Set show running end point (e.g. 3 months, or 2 years hence)
  3. Remove dates on which the show doesn’t run by punching holes in the show’s running block.
  4. Manually alter the times for the matinee performances that don’t start at the same time as the original.

Or maybe a variant is that you hard-code start times as radio choices like ‘evening’ (19:30) or ‘matinee’ (14:00) so that you can bypass the time input entirely and focus on the dates + a radio choice.

When you roll this into Txp it becomes more fun, but if you can crack the desired workflow, the rest just becomes code. A possible solution to one of the above scenarios might be to hook some jQuery into a nominated custom field — perhaps a glz_cf callback thingamyjib — so you can click a ‘+’ to add a date. Each click would add an input box and radio ‘time’ selector below the ‘extra dates’ CF, so the dates could be input. You could actually hide the real extrafield CF with bot_wtc. Upon save you would amalgamate all the dates and times and inject them into the officially designated extrafield, which would probably have to be a textarea because you’d quickly soak up 255 chars.

You can either leave the extrafield box visible for manual editing, or ‘read’ it after each save to repopulate the jQuery input boxes below so each is editable. You could also do with the page showing a visual representation of the schedule on the admin side. an smd_calendar tag ought to be able to do that. In fact, this whole charade might be better as a custom built smd_tabber tab because you can mix <txp:smd_calendar> tags in that along with some mem_form or smd_query goodness to insert/update the article and CF data.

Hey, I didn’t say it’d be easy. But it’s only code ;-)

Last edited by Bloke (2012-07-01 21:48:28)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#810 2012-07-01 22:22:37

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: smd_calendar: complete schedule / event / calendar / diary

Thanks big time, Bloke,

Let’s just say…

  • I don’t care about end times.
  • I’m going to use the timestamp fields (posted= first show / expires = last show)
  • I’ll use a designated custom field for extra fields…

So the only real trick is UX and getting the expiration to work as a repeated event and not the end of a span.

I think I’m ok with the customer visually entering values one at a time. like so…

  1. Click in field
  2. Up pops a date/time picker
  3. person selects date and time
  4. Closes picker
  5. field is populated
  6. Opens picker
  7. selects another date and time
  8. closes picker
  9. this time the field needs to recognize that a value is being added, add a delimiter and not destroy the existing value.
  10. repeat from step 6

This workflow would work. The second to last step is a doozie tho.

Offline

Board footer

Powered by FluxBB