Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#433 2010-01-07 08:42:39
Re: smd_calendar: complete schedule / event / calendar / diary
Hi lads and girls,
for some reason the smd_calendar in my install stops at january 2010 (you can’t navigate further in the future — it is accessible when manually entering month 11…).
Anybody else experiencing this problem? Did I make a common error? :-)
EDIT: This is strange; if I create a new event in 2010 (there wasn’t one yet) I can access the complete year, just untill december 2010. Is this the way it works?
http://www.aksi.be/de-bottelarij-kalender/
Last edited by Piru (2010-01-07 08:47:50)
Offline
#434 2010-01-07 11:49:49
Re: smd_calendar: complete schedule / event / calendar / diary
zeusdidit
How are you reading the ?date
URL variable and converting that to an article to display? I don’t think TXP understands ?date
by default so you need to tell it what to do when it sees one. Any reason you’re passing just the ?date§ion&category
from your calendar instead of passing title/?date§ion&category
? As it stands, your URLs are pointing to the default page and are therefore being interpreted as an article list.
In your smd_calendar form/container/cellform (whichever you are using) you should construct your event URLs such that they have <txp:title />
in them so the destination URL is a valid TXP article. If you are using the mini calendar I suggest converting it to a large calendar and using CSS and the mini-cal clone technique to make it appear to be a minical.
Does any of that help?
Piru
Yes, that’s by design. By default, the calendar only shows events up to the current year. If there are no events in that year it won’t allow navigation through that year (unless you hard-code the URL directly as you found). Check out the month
, year
and yearwidth
attributes for ways to get round this.
Last edited by Bloke (2010-01-07 11:50:55)
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
#435 2010-01-08 21:42:21
- zeusdidit
- Member
- Registered: 2007-10-16
- Posts: 111
Re: smd_calendar: complete schedule / event / calendar / diary
Stef,
Finished http://stedwardpb.com
Issue was that this was my first time using the calendar and it’s got a lot of hooks. Since the site isn’t a blog but more like a regular site; some Pages weren’t rendering and my code may have been improperly done.
I still used the mini-calendar. TXP does understand the ?date, but I’m also using /title for my Permalink Mode. This may have been part of the problem, but a larger part of the problem was that I required specific events to show on the events Section until someone selects something from the calendar. Sometimes a white page would show up when a user click through months in the calendar until a date was clicked. Again, this is was probably my coding and communication issue when trying to explain :( .
The only thing left I need to add to that site is an ability to automatically update the Article tag for the mini-calendar. I currently use
<txp:article_custom category=“church-events” section=“events” form=“article_listing” month=“2010” limit=“20” pgonly=“0” sort=“Posted asc” time=“any” />
to show article lists. Just wish I could change month=“this-year” or something.
After using the calendar I appreciate much more all the work added. I’d love to see in the future an “Extensions/Calendar” with a visual way to represent how to add events (see http://www.google.com/calendar/render) and possibly even moving them articles from the article list in the admin because you could have a lot of articles.
Also considering posting all the SQL+Files so whomever wants to build a similar site can do so or see how I build that site and maybe offer up possible code solutions. Hit me up if you want it.
Peace,
Zeus
Offline
#436 2010-01-09 10:52:52
Re: smd_calendar: complete schedule / event / calendar / diary
zeusdidit wrote:
Finished http://stedwardpb.com
Cool.
TXP does understand the ?date
Good to know it works, but I have a suspicion it’s the plugin that converts it. Just looked in the code and the very first line of the plugin checks if ?date
is set and converts it to month
internally. This was left over from mdp_calendar and I’ve no idea why it was done this way. Must have been a reason.
Just wish I could change month=“this-year” or something.
How about month='<txp:smd_cal_now format="%Y" />'
?
I’d love to see in the future an “Extensions/Calendar” with a visual way to represent how to add events
That’s kind of outside the scope of the plugin becaue it simply reads articles you’ve previously created. zem_event had a separate table for events and required you to create them distinctly from articles. While this had a few fringe benefits (not cluttering the interface for a start), I felt that it made more sense to deal in TXP’s primary currency — the Article — because it added flexibility, especially with custom fields thrown in the mix.
Most people have articles in only one section to keep everything compartmentalised. Then, it’s fairly easy to filter them out or name the section in such a way that they’re out of view (e.g. naming the section z_events and sorting your articles by section — since TXP remembers your sort criteria now). You could also make it easier to create events by using upm_savenew to quickly clone articles. Or nominate a custom field as your Posted date and then set all the real Posted dates to sometime far, far in the past. None are ideal, but there are options available to make the plugin easier to work with.
If I can improve the workflow when I eventually get round to revamping the plugin, I will.
Also considering posting all the SQL+Files so whomever wants to build a similar site can do so
That would be terrific, thanks. You could post it here if you like.
Last edited by Bloke (2010-01-09 10:53:12)
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
#437 2010-01-10 06:49:06
- immarabi
- Member
- Registered: 2008-04-29
- Posts: 57
Re: smd_calendar: complete schedule / event / calendar / diary
Hello,
Once again I have the privilege of using another one of Bloke’s plugins. Thanks again.
I seem to almost have this working using your “miniclone” idea. I tried your suggestion on how to make a mini calendar that links to the article title. I have this tag:
<txp:smd_calendar section="events" dayformat="{S,M,T,W,Th,F,Sa}" myclass="" mywraptag="p" size="small" linkposted="recur" cellform="calendar">
<txp:permlink><txp:smd_cal_info type="day" /></txp:permlink>
</txp:smd_calendar>
Then I have this for the article form that I named “calendar”:
<txp:smd_if_cal flag="SMD_ANY">
{standard}
<txp:else />
{day}
</txp:smd_if_cal>
When I do this, I get two numbers for each date that I have an event. What is it that I am doing wrong? You can see it at here
Offline
#438 2010-01-10 10:11:22
Re: smd_calendar: complete schedule / event / calendar / diary
immarabi wrote:
I get two numbers for each date that I have an event.
Try getting rid of size="small"
for two reasons:
- you’re trying to use a large calendar to simulate a small one
- using size=“small” means that
cellform
won’t work properly
See if that helps (btw, this won’t occur in the next version because size=“small” won’t exist!)
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
#439 2010-01-10 16:55:21
- immarabi
- Member
- Registered: 2008-04-29
- Posts: 57
Re: smd_calendar: complete schedule / event / calendar / diary
thanks for the reply. Unfortunately it still doesn’t fix the issue. It does seem like the cellform is not working. There is no replacement. Thanks for looking.
Last edited by immarabi (2010-01-10 16:55:39)
Offline
#440 2010-01-11 01:01:11
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: smd_calendar: complete schedule / event / calendar / diary
Bloke, I actually don’t use the calendar that much. Mainly use the smd_article_event
tag because the Txp article
tag only looks to past
and future
– not now
… would you consider looking at a simpler plugin based on smd_article_event
only?
first – here’s an outline of an issue that I’m having problems with now … maybe there’s already a solution.
I’m creating events in articles with either a single date or a start and end date (using the generic timestamp fields). I want an article listing to show (a) events that are on today and also upcoming; and (b) events that are on today
For (a) —
<txp:smd_article_event section="exhibitions" from='<txp:smd_cal_now />' form="exhibition-list" />
My problem here is that a current exhibition (an event that spans several weeks, and is on today) is not shown because “any event that has a start date in the past will be omitted from the list”. I can’t use the allspanned
attribute because it outputs for every day remaining.
For (b) —
<txp:smd_article_event section="exhibitions" from='<txp:smd_cal_now />' to='<txp:smd_cal_now offset="1 day" />' form="exhibition-list" allspanned="1" />
This almost works, but with allspanned
I get two outputs of my exhibition event that is current …
Offline
#441 2010-01-11 10:30:49
Re: smd_calendar: complete schedule / event / calendar / diary
nardo wrote:
I want an article listing to show (a) events that are on today and also upcoming; and (b) events that are on today
An interesting conundrum. I think you’re right to experiment with allspanned
and the from
attribute but, as you found, it’ll show all the remaining days of the current event. I’ve not tried it but does eventlimit="1"
work to only show the first event of any set?
Regarding the duplicate event in (b) it’s probably because day+1 takes you to the ‘next’ day which has another event on it — the next day of your current event. I wonder if from='<txp:smd_cal_now />' to='<txp:smd_cal_now />'
might work? Or from='<txp:smd_cal_now />' to='<txp:smd_cal_now offset="1 second" />'
? Just stabbing in the dark here…
would you consider looking at a simpler plugin based on smd_article_event only?
I did wonder whether to split them up so you could choose which bits you wanted (smd_cal_now would be very useful as a standalone plugin) but since the plugin tags share so much code it would result in masses of duplication. Ummm, like it is now in fact :-)
All
Just to keep everyone in the loop here, at the weekend I began rewriting the plugin from scratch.
I’ve consolidated a lot of the duplicated code into a handy function suite that both smd_calendar and smd_article_event can share, fixing a few unexpected features and enhancing some of the attributes in the process. I’ve also begun to look into the way that the flag system works to improve it and make it less nebulous, and I’ve a couple of ideas on how to completely overhaul the calendar generation system so you can be free of tables if you wish (although the css calendar suffers from one major drawback; the use of a deprecated HTML attribute). This step should also allow more flexible styling of the calendar, including the navigation.
I still haven’t fully figured out how to do micro-spanned events (on one day for example) because it’s trickier than I’d hoped. Currently, a spanned event is one that has an expiry that is one day or more greater than its posted date and does not have anything in stepfield
. Thinking about a TV show, for example, it can have:
- a start date and time — the to-air date; presumably the posted date of the article
- an end date and time — perhaps an hour later
- a weekly repetition — stepfield
- an end date and time of the series — the article expiry, perhaps 6 weeks later
- cancellations and schedule adjustments due to various external factors
One way I’m considering is to add the ability to specify a ‘duration’ of the event instead of (or in addition to) using the expiry date as the end time. This also means that weekly events such as “Rhyme Time for kids in the library” can be created with a stepfield repetition, a defined expiry date (perhaps it only runs for 6 months of the year) and each ‘episode’ can still be set to last 30 minutes.
Duration might be the key to unlocking the full potential of the plugin but it’s early days yet. If anybody has any thoughts on how stuff like this can be defined, or any better ideas, speak now!
It’s an uphill slog, but the end result will be a smaller plugin footprint (yay), and more powerful features (yay). Sadly, the huge wedge of documentation will remain :-(
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
#442 2010-01-11 13:11:48
Re: smd_calendar: complete schedule / event / calendar / diary
Thanks Bloke for your big effort to still improve the plugin!
Event management is essential for a CMS, and I must say it’s definitely your plugin that made me come back to Textpattern after using Wordpress for a while (because it had an event calendar, and Txp not, back then).
Can’t wait to see the new implementation!
I’m all for the duration idea!
Cheers!
Offline
#443 2010-01-11 15:31:56
Re: smd_calendar: complete schedule / event / calendar / diary
ditto to pascal – great to see you are still working on this plugin!
Offline
#444 2010-01-11 16:22:35
- immarabi
- Member
- Registered: 2008-04-29
- Posts: 57
Re: smd_calendar: complete schedule / event / calendar / diary
Not to be nagging, but do you think your rewrite will fix my problem that with the cellform replacement tags, it produces two dates and the replacing doesn’t work. Or is there something I am doing wrong that I should fix now to get it to work. Thanks for all your work on this. I really do appreciate it.
Offline