Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#313 2009-06-10 11:04:42

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

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

Can anyone tell me how to do a list of “What’s on Today?”. This is my starting point (below). Just need it to display all the events on today.

<txp:smd_article_event stepfield="custom_1"
     from='<txp:smd_cal_now now="?day" />'
     to='<txp:smd_cal_now now="?day" />' time="any" wraptag="ul">
     <li><txp:posted format="%H:%M" /> - <txp:permlink><txp:title/></txp:permlink></li>
</txp:smd_article_event>

Last edited by FireFusion (2009-06-10 11:12:40)

Offline

#314 2009-06-10 11:09:29

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

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

FireFusion wrote:

Can anyone tell me how to do a list of “What’s on Today?”

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...

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

#315 2009-06-10 13:28:01

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

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

Doesn’t seem to diplay anything :P

Offline

#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: 11,273
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.

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

Board footer

Powered by FluxBB