Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#111 2009-02-13 21:56:41

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,971
Website

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

I want the post also to appear in advance in the TXP news feed. How to solve this?

Could yo not roll your own using smd_article_event and mg_setheader according to isaak bowen’s custom rss feed instructions.


TXP Builders – finely-crafted code, design and txp

Offline

#112 2009-02-13 22:06:04

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,832
Website

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

jakob wrote:

Could yo not roll your own using smd_article_event and mg_setheader

Good idea, that man! Yes, that should work just fine. Nice one.


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

#113 2009-02-13 22:47:22

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

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

Use <txp:smd_article_event /> on your front page.

To create a different box for calendar events is easy (I hope). The issue I was thinking about is an integration into the classic article publishing flow.

@jakob The same is valid for feeds. I have no problem to integrate a new box into feed items or it also might be no problem to create a new feed (never did this).

But what I am aiming at is more of a problem with the TXP architecture. There is simply no mechanism to announce articles coming in the future. This has to be solved manually by adding extra articles which is not such a big problem.

Tip: There is is this elegant upm_savenew ‘save as new’ plug-in by Mary. This should be a great enhancement for similar calendar entries or for using a draft as template.

Back to the subject

The situation is simply so that I am thinking about an event calendar for a long time now. Stefs smd_calendar is definitely a great enhancement regarding the great integration with standard TXP tags. But if if I want to use TXP as an event calendar I would love event announcements to flow inside the classical article structure.

Stef, one fast thought as you are occupying so many custom fields already :) Wouldn’t it be possible to:

  • use a custom field (optional of course) for the real event date (today ‘publishing date’)
  • use the expiry date for the real event to end (as is today)
  • and publish the article as ‘article in the publishing flow’ with the actual or ‘now’ date or with another publishing date?

Maybe the <txp:smd_cal_now /> ‘mechanism’ (offsets?) could be used for that in an elegant way?

  • Thoughts about not consuming an extra custom field: What about special parameters in the extrafield?
    • ann:-10 days would publish announcement 10 days in advance to the front but not to the calendar
    • ann:now would publish announcement immediately to the front
    • multiple ann: can be multiple reminders

Example: A band is going on tour. The tour dates are in the calendar. How great would it be if 10 days before every gig a reminder is popping up on the homepage and in the feed for every venue.

Stef, if you use the standard publishing flow you don’t have to think about how TXP handles RSS :)

That’s the service I would like to offer the readers of my placeblog – being actively informed in advance through the standard publishing flow. Which btw. is, through RSS, a more powerful distribution than ever before (Twitter, FriendFeed, Facebook, SocialMedian). Don’t get me wrong, the calendar is great but I believe that the last publishing twist is still missing.

Speaking of the last publishing twist: Announcing a cell and not every singly entry is also on the wishlist :)

Last edited by merz1 (2009-02-13 22:52:24)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#114 2009-02-13 22:54:13

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,832
Website

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

Markus

To paraphrase a famous movie: “You lost me at Hello” :-S


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

#115 2009-02-13 23:00:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,832
Website

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

No, wait, I think I get it.

So you want to somehow at article creation time have your authors somehow specify “T-minus N days” and the article appears on the front page (and thus automatically in the feed) exactly N days prior to the event?


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

#116 2009-02-13 23:03:30

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

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

Stef, [off topic] How easy would it be for you to recycle the code to create an urgently missing address book for TXP? Beside a ‘normal’ address book I am thinking about a ‘Yellow Pages’ or a ‘classifieds’ TXP plug-in.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#117 2009-02-13 23:08:00

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

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

No, wait, I think I get it.

So you want to somehow at article creation time have your authors somehow specify “T-minus N days” and the article appears on the front page (and thus automatically in the feed) exactly N days prior to the event?

I know you would get the advantages of an ‘alarm’ feature in a calendar :-)

I couldn’t have said it better :) “exactly N days prior to the event” is what I want and/or ‘now’. Maybe some calendar publisher would also love to have the reminder feature in the calendar (people are strange but that’s how I use the alarm in my editorial calendar).


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#118 2009-02-13 23:51:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,832
Website

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

OK, alarm clock, I get that. Sidestepping the issue of how you can get visitors to hit the “Snooze” button (let’s face it, if you keep pinging everyone every few days that different events are coming up, they’ll soon get pissed off and want to “unsubscribe”!) or how to set the frequency between alarms, this bit still confuses me:

use a custom field (optional of course) for the real event date (today ‘publishing date’)

The “real event date” (i.e. the date the event occurs) is the article’s Posted date. You set that at article creation time, either to “now”, sometime in the future, or some time in the past. As you say, the expiry is the end date+time of the event (unless spanning, but let’s not complicate things any further!)

What about special parameters in the extrafield?

If you’re going to the trouble of announcing stuff by using a custom field, why not define a custom field yourself and use something like:

<txp:if_custom_field name="countdown">
   // compare "now" (smd_if_cal?) with article_event_date + 'countdown' field
   // if they are equal (or less than?) one another, display the article contents
</txp:if_custom_field>

in an article list on your front page? You can use smd_if for the comparison and then you have complete control over how often your articles appear on the front page (and thus ‘ping’ people) based on values you specify at event creation time.

Whichever way you approach it, you cannot have TXP ‘show’ the same article twice at two (or more) times by using regular article tags (I don’t think….) So you must either use article_custom or smd_article_event, or some other tag mechanism in your Page template to create such a specialist set of articles, to which people can subscribe.

Playing devil’s advocate a moment, if you have to go to the trouble of crafting the list yourself, why should the plugin be limited to providing this rather specific functionality out of the box? The beauty of the plugin is that it is generic enough to be applied to many situations. After all, what if you wanted the announcement to appear 10 days before and 4 days before. But someone else wanted the article to appear every day from T-minus 10 days all the way up to the event itself? And someone else wanted to announce an event every 20 minutes for one day only? Creating a system in the plugin to do that is much more difficult than giving you the freedom to do it in a way that suits your application. Offering tools so you can construct any mechanism yourself with (comparative) ease is my goal here.

And don’t forget that it’s not just date, but time as well to take into account. It was bad enough writing code that could correclty interpret date-based offsets like “third Wednesday of the month” without having to worry about how to specify a naming system for “8pm every 3 days before the event has been scheduled to start”!! (EDIT: I did have vague plans for a countdown plugin that could run a timer down to a specific event, and that event could of course be an article)

All the stuff I’ve added for people so far has been to cure deficiences in the logic of the plugin (extrafield is a prime example of a major oversight in my original thinking. The lack of smd_article_event in the beta plugin was another).

That said, if there is a logical mechanism for alarming of events and it can be done in the remaining 4kB of code I have spare in the plugin(!), then never say never.

I don’t mean to be argumentative and confrontational — sorry if I’ve missed the point you were trying to make, it’s getting late here — I just can’t figure out how this situation can be applied to a generic plugin without limiting its functionality or making it too specific and thus reducing its usefulness. Perhaps I should look at it again when I’m more awake.

if you use the standard publishing flow you don’t have to think about how TXP handles RSS :)

Ummm, maybe I’ve missed something here too. Since the native feed tags will only publish an article when its Posted date arrives, if you need to “repost” that event at N-10, N-8, N-6, N-4, N-2 and N dates/times then I’ll need to understand how feeds are constructed in order to:

a) “fake” the dates such that it appears to the native TXP feed tag that the article has been posted again. And again. And again…
b) write a custom feed function that can simulate the above

Either way, I need to figure out how it all works under the hood so it can be implemented. If you know of a way that TXP can publish the same article over and over without me thinking about it, then please let me know.

(Twitter, FriendFeed, Facebook, SocialMedian)

Yes, and these are all examples of now-based apps. You don’t post a Tweet that says “in five days time I will be mowing the lawn” and then tell it to automatically repeat that message every day do you? Or do you?! ;-)

Announcing a cell and not every singly entry is also on the wishlist :)

Pray tell, why would you announce a particular date cell when there’s nothing happening on that day?? “And next Friday, don’t forget that nothing is going on…”

P.S. regarding the address book, I don’t see how the code in this plugin can be recycled to fit that. mem_self_register has more in common with an address book than smd_calendar does! Maybe you see something I don’t in my code… I do need some new glasses.

Last edited by Bloke (2009-02-14 00:00:54)


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

#119 2009-02-14 00:00:53

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,971
Website

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

But if if I want to use TXP as an event calendar I would love event announcements to flow inside the classical article structure.

In the days before the expiry field and smd_calendar I used to do something similar by putting the begin and end date in custom_fields and using msv_if_custom_article_date to compare the end date with today’s date. The tag and the sort method also meant that an events archive was simply a reversal of the sort order and compare triggered by a variable passed in the url. The articles appear on the feed as normal published articles. BTW, this was not linked to a calendar grid, just in list form. I guess one could use that tag to bring events in the next 14 days to the front page…

There is simply no [RSS] mechanism to announce articles coming in the future

Note that in the end we found the feed slightly misleading, as the date shown in the feed reader (or by an aggregator) was the published date, not that of the event. In the end I ended up making a custom feed anyway so that I could insert the dates in front of the event title.

Having said all that, one might be able to learn from msv_if_custom_article_date but I’m not sure that it will work together with smd_calendar…

integration into the classic article publishing flow … the same is valid for feeds.

I guess needs vary – maybe you could serve up separate feeds and use one of the various feed services à la feedburner to create a combined feed.

I imagine it will be fairly typical to provide an independent event feed. Similarly the notion of a calendar will often be an separate entity, after all it mostly provides notifications of things that will happen in the future. I guess there are also calendars that show when a blog post was made in the past, but I’m not really sure what purpose they actually serve.


TXP Builders – finely-crafted code, design and txp

Offline

#120 2009-02-14 00:17:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,832
Website

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

jakob wrote:

Note that in the end we found the feed slightly misleading, as the date shown in the feed reader (or by an aggregator) was the published date, not that of the event.

Yes I can well believe that. TXP does not alter the date (well, except when it feels like it, upon changing time zone/ DST, but thinking about that makes my blood pressure rise). The hassle the plugin has to go through to “fake” the dates in repeated / spanned articles is unreal.

No matter what you do with the article, if you manage to post the article a second time, it will show the real event date in the feed. Hence to offer a “pre-ping” alarm facility I’d probably need a custom feed tag. Might not be a bad idea if I can wrap my head round it.

In the end I ended up making a custom feed anyway so that I could insert the dates in front of the event title.

Yes, and that strengthens my rather laboured post above. A calendar on a web site — as you say — is 90% of the time gonna be for “coming attractions”. Anything over and above that and you’re into the realms of customisation and tailoring to a very specific set of needs; e.g. a custom feed for alerting people every N whatevers when some events are scheduled.

I fear trying to encapsulate that in a configurable way and make it useful to a broad spectrum of users will have two net effects:

  1. the plugin will help Markus, without giving benefit to the wider community who probably have rather different needs
  2. my brain will melt as I try and make it all work. And I’m quite attached to my brain ;-)

I could be wrong, and it might actually be easy to do.

Last edited by Bloke (2009-02-14 00:19:08)


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

Board footer

Powered by FluxBB