Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#325 2009-06-14 20:38:43

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

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

saccade

Glad you like the plugin. Interesting proposal re:abridgedtitle, but I wonder where it ends? For example, someone might want to display an abridged excerpt, or body, or an abridged contents of a custom field? In the spirit of making this plugin as generic as possible I’d be tempted to offload the truncation elsewhere. Two that spring to mind:

  1. Use a custom field to hold the truncated title and in your smd_calendar form/container simply use <txp:custom_field name="short_title" /> instead of <txp:title />
  2. Truncate the title using rvm_substr

Do any of those meet your needs or have I missed your point?

FireFusion

Thanks for the bug reports. Will confirm this week and issue a fix if I’ve screwed up.


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

#326 2009-06-14 21:09:25

saccade
Plugin Author
From: Neubeuern, Germany
Registered: 2004-11-05
Posts: 521

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

bloke
oops – you’re right. Of course I already use a custom field. Conditional use of filled custom fields instead of title field in a form indeed will result in the same output.
So I was just too used to my attribute-solution so far.

Offline

#327 2009-06-16 04:19:14

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

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

So you have an event occurring monthly (stepfield shows “first saturday”) …

When you go to the individual article page for this event, txp:posted shows its first date … not good if this is in the past! … how would you replace this with notification that the event’s date is “first Saturday of the month”?

Offline

#328 2009-06-16 05:50:17

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

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

One more!

I want a calendar that looks like the small calendar – i.e. just dates … and when there’s one or more events on the date (whether single, recurring, etc), it should hyperlink to e.g. http://website.dev/?date=2009-06-25&s=events

But I can’t figure out how to do it………….. going mad!! (PS I’m using 0.42b – and cellform replacement variables ain’t working)

(Bloke – this plugin is great – the functionality is crucial)

Offline

#329 2009-06-16 08:22:00

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

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

nardo schrieb:

this plugin is great – the functionality is crucial

True but programming a calendar is really a big challenge for programmers – if not the biggest at all.

As i was happy :) my calendar did work the way expected, switching to german language messed it up.
Here i use the simple example 6 for the event article output – to no avail. I did try posting an event article after switching to german. Won´t work. Appending lang="de" did not change anything.

My TXP date format setting is dd. monthname year -> 26. Juni 2009. The setting works fine for english. But in english Juni is June.

Is there anything else i can test? May be i am wrong but i ment to have read one can append a text file with month and day names in the foreign language. I searched the manual but could not find anything referring to a text file.

Last edited by alexandra (2009-06-16 08:23:01)

Offline

#330 2009-06-16 08:30:55

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

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

alexandra wrote:

True but programming a calendar is really a big challenge for programmers – if not the biggest at all.

Yes!

I use zem_event on an almost daily basis. I hope this will replace it in future (because zem_event is not being maintained).

Offline

#331 2009-06-16 08:34:00

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

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

nardo wrote:

When you go to the individual article page for this event, txp:posted shows its first date … not good if this is in the past!

Correct. The ‘solution’ (hack) for this has been covered

when there’s one or more events on the date (whether single, recurring, etc), it should hyperlink to e.g. http://website.dev/?date=2009-06-25&s=events

The minical will do this but it’s not very good at the moment. I’m in the process of trying to remove minical from the plugin but it’s trickier than I’d hoped. I assure you cellform does work (on large calendars only at the moment) so if you post your code so far I can perhaps give you a hand.

The trick would be to use the conditional and smd_cal_info, something like this (untested) :

<txp:smd_calendar stepfield="custom_5" section="news" debug="0" cellform="miniclone">
   <a href="<txp:site_url /><txp:smd_cal_info type='section' html='1' />&date=<txp:smd_cal_info type='year,month,day' join='-' />"><txp:smd_cal_info type="day" /></a>
</txp:smd_calendar>

And in form minclone:

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

That will be close but will have two problems:

  1. it’ll probably leave you a hole on today’s date so you might have to put some more logic in the container to check for the flag today
  2. the date in the hyperlink won’t have preceding zeros on days/months less than 10

Both are fixable, though the 2nd one might need a plugin tweak as per maniqui’s suggestions a few days ago.

I hope [smd_calendar] will replace it in future (because zem_event is not being maintained).

What functionality does zem_event provide that smd_calendar does not? I’ll build it :-)


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

#332 2009-06-16 08:38:18

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

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

alexandra wrote:

switching to german language messed it up.

Really? I developed the plugin on a German site and we were swiching back and forth between English and German without issue.

The setting works fine for english. But in english Juni is June.

*confused* so you don’t want Juni to be June now?! You want it to be September or something? ;-)

one can append a text file with month and day names in the foreign language. I searched the manual but could not find anything referring to a text file.

It’s not a text file, it’s a text string. Look at the monthformat and dayformat attributes if you want to customise the month/day names.

Last edited by Bloke (2009-06-16 08:38:51)


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

#333 2009-06-16 09:31:49

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

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

Thanks Bloke – stupid error on my part, using attribute form not cellform

when there’s one or more events on the date (whether single, recurring, etc), it should hyperlink to e.g. http://website.dev/?date=2009-06-25&s=events

Your solution works well. Couple of issues:

  • when there’s two events on a date, I get the date output twice… is there a way to limit to 1?
  • sort of similar, code below is my miniclone form… when there’s an event on the current day, two dates output… how would you structure the conditionals?
<txp:smd_if_cal flag="today">
{day}
</txp:smd_if_cal>

<txp:smd_if_cal flag="event, standard, recurfirst, recur, multifirst, multilast, multi, multiprev, extra, hols">
{events}
</txp:smd_if_cal>

<txp:smd_if_cal flag="SMD_ANY">
<txp:else />
{day}
</txp:smd_if_cal>

Will write up a zem_event evaluation – based on 2+ years experience (incl. training others)

Offline

#334 2009-06-16 10:31:00

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

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

nardo wrote:

when there’s two events on a date, I get the date output twice… is there a way to limit to 1?

Ummm, probably. Can’t think of a way offhand but there must be a method.

how would you structure the conditionals?

Does this work?

<txp:smd_if_cal flag="event, standard, recurfirst, recur, multifirst, multilast, multi, multiprev, extra, hols">
  {events}
</txp:smd_if_cal>

<txp:smd_if_cal flag="SMD_ANY">
   <txp:smd_if_cal flag="today">
    {day}
   </txp:smd_if_cal>
<txp:else />
  {day}
</txp:smd_if_cal>

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

#335 2009-06-16 14:24:48

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

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

Does this work?

Nah, still getting double dates when 2 events on a day…

Offline

#336 2009-06-16 14:40:26

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

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

Bloke schrieb:

Really? I developed the plugin on a German site and we were swiching back and forth between English and German without issue.

Maybe your german DB runs UTF-8 while mine is using character set latin1? Could this cause the problem?

BTW for skipfield etc. do you insert only english month abbr like jun for june? Or when switched to another language do you insert the abbr of the languages month name? F. e. in english it is May – in german Mai. What is correct: 20-may-2009 or 20-mai-2009 when using german?

Last edited by alexandra (2009-06-16 18:08:44)

Offline

Board footer

Powered by FluxBB