Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#145 2009-02-20 18:22:15

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

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

progre55 wrote:

I do not think your set up is viable, because with 100 properties and a large amount of bookings per property, it would become impossible to mnage.

Would creating an article and just entering a posted date, expire date and category be much more work than entering those dates in an existing article?

Plus, with the current set up, you can look at an individual property (article) and see all the details about that property from one screen.

The way I’d go about that is use a sticky article for the property details, and use a custom field or category to tie the booking articles to the property article. Haven’t tried this yet (and don’t have the time now), but I think that should be doable.

Offline

#146 2009-02-20 19:01:18

progre55
Member
Registered: 2006-05-02
Posts: 668

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

Els:

I need to think about that one. Although I agree that it may not be that much more difficult and in fact, may even be a little easier when inputting the actual booking (if there was no way to span dates in the custom field), I think it may be difficult from my client point when it comes to management. Very unwieldy to have such a long laundry list under the articles tab.

Now I think I would go with your approach, if there was a way to create two tabs: the first tab would have the property articles and the second tab would have all the booking articles.

Any thoughts?

I have been using TXP for years, but have never had a reason to use the Sticky function, so I will ahve to take a closer look to understand the use and benefits.

progre55

Offline

#147 2009-02-20 20:42:04

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

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

The sections approach has the advantage of being able to segregate 2 or 3 articles to a section, for example, this giving you control with posted and expire dates to provide arbitrary dates displayed without skipfields or complex spans. Once the sections were established maintaining them wouldn’t be that complicated, and it would leave a lot of predefined and automated functions available as design tools.

Offline

#148 2009-02-20 20:43:52

progre55
Member
Registered: 2006-05-02
Posts: 668

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

Rick:

Just to clarify, are you referring to Els approach or the one that I outlined when you refer to the “section” approach ….

progre55

Offline

#149 2009-02-20 23:21:02

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

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

I’m still back here Given 100 properties, 100 sections with one article assigned to each would be possible. – seems you’ve moved on.

Last edited by rsilletti (2009-02-20 23:21:54)

Offline

#150 2009-02-21 04:16:10

hamato
New Member
Registered: 2009-02-21
Posts: 9

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

Guys, I’m sorry if this question is too basic, but I can’t figure out how to display only the active event, if there’s more then one event in the same day.

For example, I’m making a website for some TV station. There’s 10 TV shows (events) in the same day, each last for 1 or 2 hours, and they loop (recur) in 1 week period.

I need to display ONLY the article that is active at that very moment Something like: Now Playing.
Next, I need to show a title of the article that is coming next. Something like: Comming Next.

Can this be accomplished with smd_calendar? Does it have support for hours and minutes, or days only?

Last edited by hamato (2009-02-21 04:17:02)

Offline

#151 2009-02-21 09:07:41

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

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

Thanks for stepping in and helping things along in my mini absence. Haven’t got time today to address this topic but a couple of pointers:

progre55

Specifying ranges of dates is on the cards and partially implemented in my head. Think I can do it but remember that you need to put the year in the date ranges or it’ll get muddled up next year (unless the article is set to expire before the same date rolls around next year!). FYI, date ranges will probably be specifed with two full dates separated by TO (e.g. 21-feb-09 TO 5-mar-09, 11-mar-09 TO 14-mar-09 etc). Using a hyphen is too messy.

The minical always links to the current day when you click on it unless you override that with the linkposted attribute.

The ‘today’ flag is just a flag and it depends on your CSS rules as to whether the style overrides your event styles. Try changing the order of your style rules if you find ‘today’ is interfering. And look into using classlevels="cellplus" to promote events to the cell level for easier styling.

hamato

I might need to look into this particular application. The calendar is primarily designed for events on different days. It can schedule more than one event per day but the dates you specify for recurrence are just dates, not times. At leat, I’ve never tried specifying times as well; it might work! But either way, the “today” flag only highlights the current day. Also, I can’t remember if the most recent event of a day is displayed first or last in a cell. Again I’ll have to test it and find out, sorry.

Using smd_cal_now (and perhaps smd_if_cal or smd_if) you might be able to check which event is occurring ‘now’ and style it differently with smd_cal_class.

Last edited by Bloke (2009-02-21 09:11:15)


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

#152 2009-02-23 13:36:43

progre55
Member
Registered: 2006-05-02
Posts: 668

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

Els/Rick/Bloke:

After thinking about it over the weekend, I believe that if the project proceeds I am going to go El’s route. If you guys can take a look at the below structure and let me know if you see any red flags I would appreciate it.

  1. I am going to have the properties enetered into the system as Articles. The properties will be assigned a section called Properties.
  2. I am going to have the rental periods entered into the system as Articles. the Rental Periods will be assigned a section called Rentals.
  3. When a rental is booked, the end user will: (1) Create an article for the Rental putting the the Rental Confirmation Number in the title (2) Use the start and stop dates for the article as the booking period (3) Use the category field to select the property that the rental is for.
  4. When viewing the actual property, I will filter the calendar by the Category Field so that the rentals for that particular property are the only ones that are displayed.

One issue I had was ease of use for the end user. I am going to assign a log in group that is just for people who are doing the rentals. They will only see the Rental Articles. This should make it friendly for the end user. They should also be able to easily input the information since there will only need to be a couple of fields to be filled in.

Guys, please let me know if you see any issues with the above structure.

Thanks.

progre55

Offline

#153 2009-02-23 14:13:37

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

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

progre55 wrote:

the properties [ + Rentals ] entered into the system as Articles.

Makes sense to me.

the end user will: … (3) Use the category field to select the property that the rental is for.

(1) and (2) make sense but I wonder how you are going to keep the category list up to date: you imply there is one Category per property for rentals. But if there’s also one Article per property, when a new property becomes available, will someone have to enter the details in the Article and also create a new Category in case someone wants to rent the property too? Or are rentals completely separate to properties?

When viewing the actual property, I will filter the calendar by the Category Field

I think I get this. So if you are viewing 23 Acacia drive (an Individual Article) then you will make sure the calendar has ?show=23-acacia-drive so it only shows the availability that relates to that property? Very clever, I like it.

A few things to consider:

  • You can’t filter by category directly (using ?c=) because that will filter the article list AND the calendar (unless of course you assign the — redundant — 23-acacia-drive Category to the property and the rental)
  • You will probably end up:
    • specifying maintain="show" in the calendar tag so when you browse next/prev month the current category is retained
    • writing custom cells or using the conditional tag so you can compare the ?show= (or whatever name you call it) variable for a match with the list of events in that cell
    • using remap to convert show to c (this might not be necessary, it depends on your implementation above)

It’s not trivial but I think it’s doable.

Last edited by Bloke (2009-02-23 14:19: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

Offline

#154 2009-02-23 14:22:21

progre55
Member
Registered: 2006-05-02
Posts: 668

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

Bloke:

Thanks for the quick response.

You are correct, creating new properties will be a bit cumbersome, unless I can figure out a smoother system. for the immediate need, the properties are fixed.

All the cleverness credit goes to Els. I was thinking of tackling it a differnt way until he opened my mind up to this possibility.

Can you please explain a little about the first bullet point. I did think that another alternative was to use the sections as the filter. By doing this, I would have a seperate section for each property and then have the Property and Rentals share the same section. do you think this maybe a better approach? Would this be smoother and more legant?

progre55

Offline

#155 2009-02-23 14:32:18

robhert
Member
From: Perú
Registered: 2007-04-27
Posts: 206
Website

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

Hi Stef, me again. Well, I am working with tru_tags to handle ‘tags’, well, I does work good, but NO with future events (articles). There is a way to handle ‘tru_tags’ with future events?

Thanks in advance!

Offline

#156 2009-02-23 15:09:17

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

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

progre55 wrote:

All the cleverness credit goes to Els.

Yeah, when she showed me what she’d done on that booking site of hers I was like “wow, never thought of using the calendar like that” and it immediately sparked off some more ideas for the plugin. If there was a Textpattern Innovations award I’d nominate Els :-)

Can you please explain a little about the first bullet point.

I think you might run into trouble with using the default category but now I think more about it I’m not sure. If you are in section properties and viewing site.com/properties/23-acacia-drive then you are looking at an Individual Article. As soon as you try and view a category site.com/properties/?c=23-acacia-drive you are in an Article List context.

Thus, you will have to be clever about the way you view articles and will have to make sure you only show “1 article” when in the properties section, regardless of the category you are viewing. It is made more awkward by the fact the category contains the property name (aka the url title) so you have to extract that from the URL and show the correct article if using TXP’s default ?c= system.

Using a dedicated URL variable means that you never view the articles themselves by category as it is solely used by the calendar for organising content. The fact the variable you choose happens to represent a TXP category is immaterial. By using a different variable, TXP itself will not try and be clever and switch from Individual article to Article List context as you navigate from your property list to an individual property.

Your second thought of putting them all in one section might work insofar as the category then might work more easily (or maybe not…!), at the expense of having to maintain a list of sections. Can you not use cat2 (or a custom field radio set via glz_custom_fields) as the “type” of property (e.g. rent or buy) and filter using that? Hmmm, that probably doesn’t help either.

The fundamental problem here is that you are having to create two articles to represent — in effect — the same property, which smells hacky to me. There has to be a better way but I can’t figure it out right now. Would it help if the date ranges were in the calendar plugin so you could have one “property” and use the extrafield to list when it is rented out e.g. 21-feb-09 TO 28-feb-09, 5-mar-09 TO 8-mar-09?

EDIT: mind you, with only 255 characters in a custom field, it’s going to get pretty tight in there and you’ll have to keep revisiting properties to remove rental dates that have passed just so you have enough space to store dates that are coming up.

Last edited by Bloke (2009-02-23 15:11:32)


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