Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#316 2009-06-12 20:32:32

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

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

Feature request: The ability to display events by category parent.

For example to call all article events that have the category assigned with the category parent of “Events Calendar”.

<txp:smd_calendar category_parent="Events-Calendar" stepfield="custom_1" time="any">

Last edited by FireFusion (2009-06-12 20:32:56)

Offline

#317 2009-06-12 20:50:32

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

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

FireFusion wrote:

Feature request: The ability to display events by category parent.

Good idea. Look out for a subcats attribute in an smd_calendar near you :-)


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

#318 2009-06-12 23:42:28

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

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

Wonderful calendar! Great!

I like all those attributes :) And I’d like to have more of them ;)

Especially in German titles can get very long. Too long for a calendar.
And from the point of content: If you have one article for making an event interesting and presenting it in a calendar it will get difficult to solve both requests.

So may I suggest another feature?
(I had this working for long in my tweaked mdp_calendar – but now I want to switch to smd_calendar.)

abridgedtitle the ID of a field (normally a customfield) which may contain a shortened (or different) title. If the field contains text it will be used instead of the Title. If it is empty the Title will be used.
(The shortened title will be used for the linked text only. the href’s ‘title’-attribute will show the full Title of the article.)

So users can enter a shortened title or different wording (in the designated custom field) if they want to. This will be used in the calendar, while the full title will be used in single article or article-list mode (and shown as the title-attribute hovering over the link). (Of course they can choose to use shortened titles in article lists too by using a form.)
It is just analogue to the alternative use of excerpt (if there is one) or body (if there is not excerpt).

What I tried successfully so far:

In the attributes’ definitions:

'abridgedtitle' => '', 

then a new variable before every $op = (lines 330, 419 und 533 in 0.42b):

$usetitle = ($row[$abridgedtitle]) ? $row[$abridgedtitle] : $row['Title'];

and the $op…s modified (replaced first $row[‘Title’] by $usetitle), e.g.:

$op = ($thing) ? parse($thing) : (($form) ? parse_form($form) : (($size=="small") ? '' : href($usetitle, permlinkurl($row), ' title="'.$row['Title'].'"')) );

I hope this is not a stupid solution and I didn’t miss if such a feature has been addressed before (I read most of the topic here but lost few recent pages).

Last edited by saccade (2009-06-12 23:45:50)

Offline

#319 2009-06-13 15:58:41

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

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

Bloke wrote:

Untested but does this work?

<txp:smd_article_event
     from='<txp:smd_cal_now now="?day ?month ?year 00:00:00" />'
     to='<txp:smd_cal_now now="?day ?month ?year 23:59:59" />' time="any" wraptag="ul">
blah blah blah...

Got it working now with the format attribute.

     from='<txp:smd_cal_now now="?day ?month ?year 00:00:00" format="%d-%m-%Y" />'
     to='<txp:smd_cal_now now="?day ?month ?year 23:59:59" format="%d-%m-%Y" />'

Last edited by FireFusion (2009-06-13 15:58:54)

Offline

#320 2009-06-13 16:00:49

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

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

Opps still haven’t got the time in hours/mins/seconds part to work yet…

<txp:smd_article_event section="courses" stepfield="custom_1" omitfield="custom_2" extrafield="custom_3"
     from='<txp:smd_cal_now now="?day ?month ?year 00:00:00" format="%d-%m-%Y" />'
     to='<txp:smd_cal_now now="?day ?month ?year 23:59:59" format="%d-%m-%Y" />'  time="any" wraptag="ul">
     <li><txp:posted format="%H:%M" /> - <a href="<txp:permlink />"><txp:title /></a></li>
</txp:smd_article_event>

Offline

#321 2009-06-13 16:22:40

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

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

Hi FireFusion

Try removing the time both from “from” and “to” attributes and then, set the <txp:smd_cal_now /> on (the one on the “to” attribute) to one day offset (offset="1 day").


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#322 2009-06-13 16:37:14

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

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

Hi maniqui,

Thanks for taking a look :)

i’m using this code. And my Textpattern clock is set to GMT and reads 5:34PM

<txp:smd_article_event section="courses" stepfield="custom_1" omitfield="custom_2" extrafield="custom_3"
     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" offset="1 day" />'  time="any" wraptag="ul">
     <li><txp:posted format="%H:%M" /> - <a href="<txp:permlink />"><txp:title /></a></li>
</txp:smd_article_event>

If you look on my development site (sorry ugly and all over the place at the moment). The “What’s on Today” box in the right column is showing an event that started at 10:52AM. I’d like that to have disappeared as it’s over now. Any ideas why it’s not working?

Thanks for your help.

Last edited by FireFusion (2009-06-13 16:47:10)

Offline

#323 2009-06-13 16:40:07

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

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

Bug Report

If you click on one of the days in the mini calendar on this page and then on the arrows moving the calendar to the next month it doesn’t retain the current section.

Offline

#324 2009-06-13 17:52:29

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

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

Also another possible bug. smd_article_event doesn’t seem to be obeying the expired articles rule. If you select a day in the mini calendar like the 11th, nothing is shown as the article on that day is expired. But for other days with non expired events it works.

See mini calendar

<txp:if_article_list>

<txp:if_category>
	<h1><txp:category title="1" /></h1>
	<txp:smd_article_event section="courses" stepfield="custom_1" omitfield="custom_2" extrafield="custom_3" time="any" sort="Posted asc" category='<txp:category />' limit="9999" form="courses_event" eventlimit="6" />

<txp:else />

    <txp:smd_if field="urlvar:date" operator="defined">
<h1>Events on <txp:smd_cal_now now="{smd_if_date}" format="%d %B %Y" /></h1>

        <txp:smd_article_event section="courses" stepfield="custom_1" omitfield="custom_2" extrafield="custom_3"  expired="1" time="any" sort="Posted asc" from='<txp:smd_cal_now now="{smd_if_date}" format="%d %B %Y" />' to='<txp:smd_cal_now now="{smd_if_date}" offset="1 day" format="%d %B %Y" />'  form="courses_event" />

    <txp:else />

<h1>What's on at KMC</h1>
        <txp:smd_article_event section="courses" stepfield="custom_1" omitfield="custom_2" extrafield="custom_3" time="any" sort="Posted asc"
     from='<txp:smd_cal_now now="01-?month-?year" format="%d-%m-%Y" />' to='<txp:smd_cal_now now="01-?month-?year" offset="1 month -1 day" format="%d-%m-%Y" />' limit="999" form="courses_event" />
    </txp:smd_if>

</txp:if_category>


<txp:else />

<txp:article time="any" />

</txp:if_article_list>

Offline

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,497
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.

Hire 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

Board footer

Powered by FluxBB