Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#361 2009-09-13 03:10:55

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

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

This is just an amazing plugin. I’ve spent the better part of the day customizing to the nth degree, and I am extremely excited about its power. I have two key questions before I spin any more mental tires:

1.) For recurring events, is there a way to set a relative limit with <txp:smd_article_event />? For instance, if I have a weekly recurring meeting every Monday, and I have the following bit: <txp:smd_article_event stepfield="custom_2" form="event.full.event-details" limit="5" id='<txp:article_id />' />, it will show me dates starting from the very first instance of the plugin. While adding time="future" kills all past instances, it also kills the listing if it is on the current day. (Basically, I want time="future" but also show the event if it falls on today.) Hope that makes sense.

2.) Why can’t I use <txp:smd_if_cal> inside forms from <txp:smd_article_event />? The absolute beauty of this plugin is to be able to recycle the events outside the calendar, but I don’t have the same power. Or maybe I’m missing something huge.

Looking forward to 0.5, Bloke.


Kevin
(graphicpush)

Offline

#362 2009-09-13 14:52:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

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

kevinpotts

Two very good questions. Let me think off the cuff here.

1) You can probably use the smd_article_event’s from and/or to attributes. To set from to today’s date for example, use some code from Example 6 in the docs:

<txp:smd_article_event stepfield="custom_2"
     form="event.full.event-details" limit="5"
     id='<txp:article_id />'
     from='<txp:smd_cal_now />'
 />

That should (untested) use ‘any’ event but then limit it to events from today. I don’t think you need to use to but if you do, apply the same logic and set the now attribute as well. The only downside being you’d have to specify a fixed year; currently 2038 will do as that’s the year 32-bit UNIX expires :-)

2) You can’t use <txp:smd_if_cal> inside forms in <txp:smd_article_event /> because I’m a dunce and didn’t allow it. Essentially I have to set all the flags up based on the current event the tag sees [as an aside, I think you can actually do this if you are using smd_article_event inside an smd_calendar tag because the calendar will set the flags for you, but it probably won’t quite be the desired effect]

The tricky part is that if I set the flags inside smd_article_event they’ll clash with the ones in smd_calendar at present. smd_if_cal has no frame of reference about where it is being used. I’d need to build this in so the flags are set correctly and don’t bump into each other. Not impossible, but not easy. I’ll add it under the To Investigate category and see what I can do.

BTW, do you have an example of something you’re trying to achieve — perhaps a form that you want to use inside both tags — so I can use that as a basis to work on this feature? Thanks.


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

Txp Builders – finely-crafted code, design and Txp

Offline

#363 2009-09-15 04:31:21

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

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

I’m using an article’s posted date and expiry date to be an event’s ‘from’ and ‘to’ range

The following code is parsed when the URL has date variables – e.g. /events?d=10&m=12&year=2009

<txp:smd_article_event limit="999" section="events" time="any" expired="1" allspanned="1" from='<txp:smd_cal_now now="?day ?month ?year" format="%d-%m-%Y" />' to='<txp:smd_cal_now now="?day ?month ?year" format="%d-%m-%Y" />' stepfield="custom_10">
<txp:if_different><dd class="date-dd">
<txp:posted format="%A %e %B" /><txp:chh_if_data> – <txp:expires format="%A %e %B" /></txp:chh_if_data>
</dd></txp:if_different>
<dd><txp:permlink><strong><txp:title /></strong></txp:permlink></dd>
</txp:smd_article_event>

This is fine for events on a single day … but multiday events are output showing their posted date (or start date) as the date passed in via the URL

e.g. an event with start date 1 January and end date 15 December is shown as starting from 10 December d=10&m=12&year=2009

Any suggestions how to avoid this or work around it?

Last edited by nardo (2009-09-15 04:32:34)

Offline

#364 2009-09-23 19:44:48

jpdupont
Member
Registered: 2004-10-01
Posts: 752

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

Is it possible to use a custom field as date field (not the standard article date fields) ?

Last edited by jpdupont (2009-09-23 19:45:29)

Offline

#365 2009-09-23 19:59:03

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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

Yes, it’s possible.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#366 2009-09-24 04:47:25

jpdupont
Member
Registered: 2004-10-01
Posts: 752

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

Awesome, maniqui !
But … how ? Where tell to smd_calendar to use custom_1 as date of the event ?

Offline

#367 2009-09-24 20:09:29

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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

hi jpdupont,

check the datefields attribute on plugin help (plugin help is also bundled with the version you installed on your TXP site).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#368 2009-09-24 20:22:01

jpdupont
Member
Registered: 2004-10-01
Posts: 752

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

big thanks maniqui !!! I read the help but I not see this attribute :-(

Offline

#369 2009-09-27 00:12:56

assaultonaudio
Member
From: Montreal
Registered: 2009-09-03
Posts: 11

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

Hey there,

I have a site where we are using smd_calendar to present the shows that are happening at the venue. When I change months using the next or previous arrows, and select a date on that month, the calendar is automatically set back to the current month.

Is there any way to maintain the month that the calendar is on when an individual event is selected?

Thanks in advance to anyone who has any ideas/solutions!

Cheers

Offline

#370 2009-09-30 11:43:11

FireFusion
Member
Registered: 2005-05-10
Posts: 698

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

This plug-in is the dream ticket with the new glz_custom_fields. Dropdown list make repeating dates easy to enter :)

Just waiting for the new version with bug fixes so that it can be truly useful.

We could recreate a far superior zem_event if these plugins talk to each other well enough!

Last edited by FireFusion (2009-09-30 13:44:16)

Offline

#371 2009-09-30 13:41:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

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

assaultonaudio wrote:

Is there any way to maintain the month that the calendar is on when an individual event is selected?

Sorry for the delay getting back to you — this one slipped through the net. Inside your calendar form you can add the current month and year onto the end of every link like this:

<txp:smd_calendar blah="blah">
<a href="<txp:permlink /><txp:smd_cal_info type="month, year" html="1" escape="" />"><txp:title /></a>
</txp:smd_calendar>

You might also like to check out the maintain attribute which might be of assistance.

Also, if you want to maintain the month and year on the next/prev links, look at the smd_horizon plugin which has a urlvars parameter that allows you to maintain state.


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

Txp Builders – finely-crafted code, design and Txp

Offline

#372 2009-09-30 13:44:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,448
Website GitHub

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

FireFusion wrote:

This plug-in is the dream ticket with the new glz_custom_fields. Dropdown list make repeating dates easy to enter :)

Way cool! The date picker might come in very handy too for adding cancelled/extra dates.

Just waiting for the new version with bug fixes so that it can be truly useful.

Slow progress, sorry. Other things jumped the queue and took priority.


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

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB