Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#205 2009-03-16 12:41:23
Re: smd_calendar: complete schedule / event / calendar / diary
Thanks Stef, that’s done the trick.
Offline
#206 2009-03-16 13:12:43
Re: smd_calendar: complete schedule / event / calendar / diary
Re. iCal: Stef, thanks for the link to the iCal export form! I saw that but had forgotten about it.
You’re right. iCal import is a totally different thing. I think it’s easier to use an external Google or airset.com calendar widget as a nicely formatted workaround instead :)
…you come up with some idea I shoot it down, it’s not personal!
I know and I like to stretch the limits a little bit this way :)
Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML
Offline
#207 2009-04-13 09:20:51
Re: smd_calendar: complete schedule / event / calendar / diary
I’d like to display 12 months, beginning with the current month, of static mini calendars on a single page. So far I cannot figure out the correct way to do it. I was hoping the following would work, but no go.
<txp:smd_calendar time="future" firstday="0" month="<txp:smd_cal_now />" static="true" />
<txp:smd_calendar time="future" firstday="0" month="<txp:smd_cal_now offset="1 month" />" static="true" />
<txp:smd_calendar time="future" firstday="0" month="<txp:smd_cal_now offset="2 months" />" static="true" />
and so forth.
What’s the best way to go about it?
Also, is there a way to not display the events as links?
Offline
#208 2009-04-13 09:54:35
Re: smd_calendar: complete schedule / event / calendar / diary
cynicalpink
You were very close :-)
<txp:smd_calendar time="future" firstday="0" month='<txp:smd_cal_now format="%m" />' static="1" />
<txp:smd_calendar time="future" firstday="0" month='<txp:smd_cal_now format="%m" offset="1 month" />' static="1" />
<txp:smd_calendar time="future" firstday="0" month='<txp:smd_cal_now format="%m" offset="2 months" />' static="1" />
...
You need the format
attribute to return a numeric representation of the month from 1 to 12, hence %m.
Also, is there a way to not display the events as links?
Yes, it is only that way by default. If you use the form
attribute you can configure how to display events, for example if you added form="my_events"
then you could put this in your my_events form:
<txp:title />
<div class="times">
Start: <txp:posted />
End: <txp:expires />
</div>
If you want to go further still, look at the cellform
attribute in the plugin help. Hope that gets you going.
Last edited by Bloke (2009-04-13 10:37:35)
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
Online
#209 2009-04-13 10:51:56
Re: smd_calendar: complete schedule / event / calendar / diary
I knew I was missing something obvious. Thanks for the quick response.
Offline
#210 2009-04-14 10:16:36
Re: smd_calendar: complete schedule / event / calendar / diary
Hi all,
I’m trying to put together a form that lists other future events within the category of the event article currently being viewed (i.e. if you are viewing details of an event which is in the ‘courses’ category then other events from the category would be listed). I’ve got this far but it’s not outputting any events although there are some –
<h6><txp:category1 title="1" /></h6>
<txp:if_category>
<txp:smd_article_event section="diary" stepfield="custom_1" skipfield="custom_2" omitfield="custom_3" extrafield="custom_4" sort="Posted,Title asc" time="future" wraptag="dl" >
<txp:if_different>
<dt><txp:permlink><txp:title/></txp:permlink></dt>
</txp:if_different>
<dd><txp:posted /></dd>
</txp:smd_article_event>
<txp:else />
<p>No other scheduled <txp:category1 title="1" /> at the moment.</p>
</txp:if_category>
I’m also considering using some form of tooltip on calendar entries so you could quickly view Event name, location, time without having to go to the full article. Is there any particular javascript (preferably jQuery) that anyone can recommend and is it straightforward to implement?
Thanks in advance for any help.
Offline
#211 2009-04-14 10:34:58
Re: smd_calendar: complete schedule / event / calendar / diary
decoderltd
Have you tried adding category='<txp:category />'
as an attribute to smd_calendar? Or do you mean it’s not outputting any at all right now, when there are some future event articles in the ‘diary’ section?
In a past life the calendar tags automatically filtered events by current section / category / author but I took that out a few versions ago. When I get more space in the plugin (i.e. when TXP 4.0.9 is officially released and we get 16Mb of codespace instead of 64Kb!) I’ll go nuts and probably offer an option to automatically reinstate this behaviour to save you doing it manually.
As for tooltips you can look at the standard plugin or jTip which is pretty funky. Ease of use depends on how comfortable you are with javascript! For a simple tooltip you could just cram the link’s title
attribute with a load of stuff, e.g.
<txp:permlink title='Location: <txp:custom_field name="location" /> | Time: <txp:posted format="%T" />'>
<txp:title />
</txp:permlink>
and let the browser do all the work.
Last edited by Bloke (2009-04-14 10:36:01)
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
Online
#212 2009-04-14 11:05:11
Re: smd_calendar: complete schedule / event / calendar / diary
Hi Stef,
Thank you for that, I’ve tried category='<txp:category />'
but without the if_category
tag it seems to output all events irrespective of category. If I reinstate the if_category
tag I only get the else
statement as before. But don’t worry, if it’s problematic I can list a selection of upcoming events instead.
Thank you for the tooltip options, I’ll look into those (although you probably remember the extent of my Javascript knowledge from my various smd_gallery posts!).
One other question, I notice that when I click a recurring calendar event it returns the original post date (not the actual clicked calendar date), is there a way around this? My form is:
<dl>
<dt>Date:</dt>
<dd class="first"><txp:posted format="%A, %B %d, %Y" /></dd>
<dt>Venue:</dt>
<dd class="first"><txp:custom_field name="event venue" /></dd>
<dt>Time:</dt>
<dd class="first">Starts at <txp:posted format="%H:%M" /></dd>
</dl>
<br />
<txp:body />
If possible I would also like to show all the dates of a spanned event in the above form (rather than just the first). Thanks.
Offline
#213 2009-04-14 11:47:55
Re: smd_calendar: complete schedule / event / calendar / diary
decoderltd wrote:
I’ve tried
category='<txp:category />'
but without theif_category
tag it seems to output all events irrespective of category. If I reinstate theif_category
tag I only get theelse
statement
Hmmm, that smells like a bug to me. I’ll have to try it out on a test site to confirm. Just looking at my code, it may be due to the tag being used in an article_list vs an individual article mode. I think it only works reliably in an individual article context (but I may be wrong, it’s just a hunch) because I’m checking against Category1 and Category2 instead of the ‘global’ category.
Just out of curiosity, is your ULR bar something like site.com/diary?c=courses
and your smd_article_event tag in an individual article form? I might have to rethink the category list option because clearly it’s not going to work when category lists are not individual articles!
when I click a recurring calendar event it returns the original post date (not the actual clicked calendar date)
Yes, it’s a feature *cough* of the way things are done in TXP. Consider that you only have 1 “real” article Posted on one “real” date, so when you click on a permlink, TXP dutifully takes you to that article, whereby all you have is the “real” article info available to you. That’s the problem. All the recurring dates are “virtual” articles.
However, I have outlined a workaround somewhere (either in the help or, more likely, in a post here) which involves some trickery. What you do is pass the ‘fake’ date as a ?
URL variable along with the permlink, thus your permlink might be: site.com/articles/learning-tai-chi?dat=10-may-2009
. Then, in your Learning Tai Chi article (which is actually published today), you use some plugin such as smd_if or adi_gps to grab this date and display it instead of the ‘real’ date. If the URL date is missing or mangled you display the article’s real date as a fallback.
Another option is to take someone to a “booking” form on click. Using the same technique of passing info from the calendar, you can pre-fill details into textboxes, thus saving your visitors some typing.
If possible I would also like to show all the dates of a spanned event in the above form (rather than just the first)
Hmm, that’s tricky. You’ve stumped me! It involves maths I think because all we have is a start and end date. Oh, hang on, I think you can use smd_article_event with the allspanned
attribute. It’s not designed explicitly for this purpose but it might work because it treats spanned events as individual days, so in the container you can put a <txp:posted />
tag and see each day separately. Try that and let me know if it works. If not I’ll have to get my thinking legs on.
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
Online
#214 2009-04-14 12:09:50
Re: smd_calendar: complete schedule / event / calendar / diary
Thanks Stef, that all makes sense – I’ll try your allspanned
idea and see what happens. I’ll also search out the ‘fake date ‘ workaround.
Going back to your txp_category query
, when I have an event article open the URL displays http://www.site.com/section/title
, I’m using category_1 to store the event category. Form-wise, I have an article form which lays out the page (column, main content, etc), I’ve then created a separate form for the category event listing under discussion and called that in using txp:output_form
Offline
#215 2009-04-14 14:41:37
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: smd_calendar: complete schedule / event / calendar / diary
decoderltd
If I understand you correctly, you are talking about an individual article page, and in that case you need category='<txp:category1 />'
(or category='<txp:category1 />,<txp:category2 />'
if you are using both categories) instead of <category='<txp:category />'
.
Offline
#216 2009-04-15 10:00:41
Re: smd_calendar: complete schedule / event / calendar / diary
Great, thanks Els. That now works perfectly if I don’t use the <txp:if_category>
+ <txp:else />
tags. This is handy for the times when there are scheduled events but I need a workaround so a notice appears when there isn’t. Any ideas on a workaround?
Last edited by decoderltd (2009-04-15 10:01:04)
Offline