Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#757 2011-09-23 12:39:09

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

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

Teemu wrote:

dynamically fetch years that have articles?

If you didn’t want to use SQL you could always cheat like this:

<select name="year_select">
<txp:article_custom section="events" sort="posted asc" limit="99999">
   <txp:if_different>
      <option><txp:posted format="%Y" /></option>
   </txp:if_different>
</txp:article_custom>
</select>

In your case you won’t want to use <txp:posted> of course, so you’ll have to be clever. Perhaps (untested):

<txp:smd_cal_now format="%Y" now='<txp:custom_field name="custom_6" />' />

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

#758 2011-09-25 09:07:31

Teemu
Member
From: Shanghai
Registered: 2010-04-27
Posts: 60

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

Bloke wrote:

If you didn’t want to use SQL you could always cheat like this:

<select name="year_select">
<txp:article_custom section="events" sort="posted asc" limit="99999">
   <txp:if_different>
      <option><txp:posted format="%Y" /></option>
   </txp:if_different>
</txp:article_custom>
</select>

In your case you won’t want to use <txp:posted> of course, so you’ll have to be clever. Perhaps (untested):

<txp:smd_cal_now format="%Y" now='<txp:custom_field name="custom_6" />' />

Thanks Stef,

That works beautifully.

Last edited by Teemu (2011-09-25 09:08:02)

Offline

#759 2011-10-11 11:08:23

simoin
Member
From: Ireland
Registered: 2009-02-10
Posts: 50
Website

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

Having some bother with smd_calendar and I’m wondering is it because I’m stuck with a website that only supports messy urls?
I have the section set to articles in smd_calendar and the events are showing in the calendar but when clicked on
I’m not going to the correct url.

and for example this is the link I am going to when clicking on a date

http://www.deancrowetheatre.com/new/?date=2011-10-27&s=articles

when I need it to go to this url,

http://www.deancrowetheatre.com/new/index.php?id=13

here is the code I’m using below

<div id="calendar" class="widget widget_calendar">
<h3>Calendar<span class="arrow"></span></h3>

<div id="calendar_wrap">

<txp:smd_calendar size="small" id="small-calendar" datefields="custom_9"  section='<txp:variable name="widget_calendar_section(s)" />' firstday="1" navarrow="&laquo;,&raquo;" />


</div> <!-- /#calendar_wrap -->
</div> <!-- /#calendar -->

any help much appreciated.

Offline

#760 2011-10-11 13:53:15

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

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

simoin

?date= view is the way the small calendar works by default. And it automatically links to the current section. If you want to alter the behaviour you’ll need to either use a form or the plugin’s container to customise it to make the correct links. If that doesn’t do quite what you want you can always use a large calendar and make it act small, again, by customising the look of each cell through a Form/container.


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

#761 2011-10-11 14:52:30

simoin
Member
From: Ireland
Registered: 2009-02-10
Posts: 50
Website

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

Thanks Bloke, I think I get it now,
I am using a large calendar scaled down, with a form, but how do I keep it so the date number is the link?

Edit:
After doing a bit more searching, I found what I was looking for here,

http://forum.textpattern.com/viewtopic.php?id=29375&p=45
in a post by immarabi

Last edited by simoin (2011-10-11 15:29:30)

Offline

#762 2011-10-13 19:43:57

drudog
Member
Registered: 2011-02-01
Posts: 20

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

Hey there,

Very rudimentary question, but I’ve been trying to figure out how to get the permlinked cal-event to open up on a new page so that I might incorporate a lightbox effect for each event when clicked.

Right now I have my cal events showing up in the default fashion (event title only) on the large calendar but when I click on one it takes me to another page with the error: Textpattern Notice: Page template events does not contain a txp:article tag on line 546.

So I tried adding in some if_individual_article tags like I would for a regular blog-style page but when I do so all the events disappear.

I’ve tried to digest all the manual and forum pages but it looks like I’ve missed something very core in the implementation of smd_calendar. Anyone know where I’m going wrong? Here’s the code:

<txp:smd_calendar section="events" stepfield="custom_1" form="cal-events" dayformat="full" id="cal" />

and in the form ‘cal-events’:

<txp:if_individual_article>
<div>
   Event: <txp:permlink><txp:title /></txp:permlink>
   <br /><txp:excerpt />
</div>
<div class="evtime">
   Start: <txp:posted format="%H:%M" />
</div>
<div class="evtime">
   End: <txp:expires format="%H:%M" />
</div>
<txp:else/>

<txp:permlink><txp:title /></txp:permlink>

<txp:if_individual_article>

Offline

#763 2011-11-09 06:16:48

kr37
Member
From: Colorado
Registered: 2011-11-06
Posts: 28

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

Hello, thank you Stef for this plugin, and others for the support as well. And I apologize up front, I’ve tried to find the answer in this forum and at http://stefdawson.com/sw/plugins/smd_calendar

I’m basically trying to use smd_calendar to replace this: http://www.meditateinfortcollins.org/calendar-old/

1. What would be the easiest way to schedule an event to be on every weekday?
I’m using stepfield=“1 day” and omitfield=“saturday, sunday, first sunday, first saturday, second sunday, second saturday, third sunday, third saturday, fourth sunday, fourth saturday, fifth sunday, fifth saturday”

2. Is it possible to output a day’s events a) in order of time-of-event and b) listing what time they are at?

3. If (2) is yes, then can one specify an event happens at 10am on the 10th and at 4pm on the 25th?

Thank you for answering these probably basic questions.

Offline

#764 2011-11-09 12:51:03

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

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

kr37 wrote:

What would be the easiest way to schedule an event to be on every weekday?

You could try extrafield="custom_2" (or whatever custom field number you nominate) and then put {Mon:Tue:Wed:Thu:Fri} in it on the event(s) you want to occur every day. Untested, but I think it works like that. You might even be able to specify {Mon-Fri}, can’t remember how clever (or not) I made it!

Is it possible to output a day’s events a) in order of time-of-event and b) listing what time they are at?

Yes. <txp:smd_article_event> will do that if you specify the sort="Posted asc" attribute. You can use any Txp tags in the container to format the output of each event how you like.

can one specify an event happens at 10am on the 10th and at 4pm on the 25th?

I think so. Try using extrafield again and set the date to be 2011-11-25 16:00:00. I think it takes time into account and uses that as the recurring event time. But it might strip it off and keep it at the main event’s time. If it works, let me know. If it doesn’t, let me know and I’ll see if I can make it work that way. This’ll be so much easierif/when I get timefields sorted…


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

#765 2011-11-10 03:13:48

kr37
Member
From: Colorado
Registered: 2011-11-06
Posts: 28

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

Hi Stef,
Thanks for the quick reply. I’ve been playing with it, with custom_2 for stepfield, 3 for omitfield, 4 for extrafield.

These work:
Nov 7 => Nov 11 , second tuesday

These don’t: mondays, mon, mon => fri
Anything in {}, Anthing with colons or a hyphen —nothing displays for {Mon:Tue:Wed:Thu:Fri}.

Could you explain what the brackets signify?

Things that specify a particular day of month work, but I can’t get anything that keys off of day of week to work. I.e. anything that would repeat weekly on more than one day each week.

Thanks again for the help. KR

Offline

#766 2011-11-10 20:20:07

jnr
New Member
From: Melbourne, Australia
Registered: 2011-11-10
Posts: 2
Website

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

Hi stef, not sure if this has been posted however I have found the calendar post back does not work with article_custom tags for instance if I embed the calendar in page and use txp:article_custom to display the individual article for the event it doesn’t work. Apart from that everything you do for txp is simply inspirational cheers

Offline

#767 2011-11-10 20:38:17

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

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

jnr wrote:

the calendar post back does not work with article_custom tags

If the event is recurring, or a date other than the Posted date of the actual original article, then it won’t. Use <txp:smd_article_event /> instead.

Even with that, the base article Posted date will be shown unless you use some trickery to display the one clicked from the calendar (e.g. by passing the clicked date to the destination URL and reading that value in). There is just no way round Txp’s built-in Posted date with the built-in tags. smd_calendar simply uses article skulduggery and some PHP magic to “fake” the dates of all bar the base event.

The examples in the help file touch on this so have a look there for inspiration. I’m partway through a working demo on my own site which covers this in greater detail; just need to get round to finishing it.

kr37

I haven’t forgotten your issue. Looking into it. I might have completely forgotten about this kind of feature so I’m looking into ways of making the sort of thing you want to achieve easier. Hang in there. I’ve got a newer version of the plugin waiting to go so I might just roll this request in to that if I can do it easily enough. I’m testing stuff for you and getting back into the plugin’s mindset, which takes some brainpower.


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

#768 2011-11-16 19:04:54

kr37
Member
From: Colorado
Registered: 2011-11-06
Posts: 28

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

Hi Stef,
Just letting you know I haven’t disappeared. Thank you so much for all the hard work!

Offline

Board footer

Powered by FluxBB