Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#136 2009-02-18 21:13:19

woof
Member
Registered: 2004-08-01
Posts: 128

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

progre55 – very sorry for the confusion… I should have made it clear that I was referring to the large calendar with that styling suggestion.

I was thinking that you could achieve what you want by using the default large calendar: size="large" (styled to make it small enough to fit in a narrow div) instead of the mini one: size="small"

Here’s an example that seems to work ok for me:

The tag:

<txp:smd_calendar form="cal_S_evform" spanform="cal_S_multis" 
     stepfield="custom_11" omitfield="custom_12" skipfield="custom_13" extrafield="custom_14" 
     classprefixes="" class="smallcal" emptyclass="empty" dayformat="{S,M,T,W,T,F,S}"  monthformat="ABBR" size="large" section="calendar" firstday="1"  />   

notes:
section="calendar" is specific to my setup as are the 4 step, omit, skip, and extra field values
Using dayformat="{S,M,T,W,T,F,S}" and monthformat="ABBR" above ensures that this calendar will take up as little horizontal space as possible

Here are the two forms used by the tag above (these are are based on Example 2 in the plugin docs which use <txp:smd_if_cal> tags to apply separate styles or content to beginning, end and in-between events — although I’m not using them here I’ve kept them in case I need them later)

cal_S_evform

<span class="calevent">
<txp:smd_if_cal flag="recur">
  <txp:permlink>(RECUR)</txp:permlink>
<txp:else />
  <txp:permlink><txp:title /></txp:permlink>
<txp:smd_if_cal flag="multifirst">
     <span class="right"></span>
   </txp:smd_if_cal>
   <txp:smd_if_cal flag="recurfirst">
      <span></span>
   </txp:smd_if_cal> 
</txp:smd_if_cal>
</span>

cal_S_multis

<span class="calevent">
<txp:smd_if_cal flag="multi, multiprev"
     logic="or">
   <txp:permlink><txp:title /></txp:permlink>
</txp:smd_if_cal>
<txp:smd_if_cal flag="multilast">
  <txp:permlink title="<txp:title />">
      <span class="left"><txp:title /></span>
   </txp:permlink>
</txp:smd_if_cal>
</span>

stylesheet disclaimer – i’m a css novice :-)

table.smallcal {border-collapse:collapse;border-spacing:0; font-size:10px; width: 100%;}

table.smallcal tr {text-align: left; vertical-align: top;}
table.smallcal th, table.smallcal td {padding: 1px;border:1px solid #FFF; background-color:#6b883f; color:#fff; font-weight: bold; text-align:center;}
table.smallcal td {background-color:#ddd;color:#636F6F; height:30px;}

table.smallcal td.event{background-color:#B3C75F;color:#FFF}
table.smallcal td.event:hover{background-color:#FFF;color:#000}
table.smallcal h4 {color: #495D2B; margin:0px;}
table.smallcal .today h4 {color: #cc0000;}

table.smallcal .calevent a {background: url(../images/event_icon.png) no-repeat 3px 0; text-indent: -999em; display:block;}

icon
here’s a link to the icon I’m using http://i39.tinypic.com/sbshs1.png (the hosting service has renamed it)

All this gives you a small calendar, with hidden event titles replaced by a small icon in the table cells, which link directly to the individual calendar article as opposed to the section.

Hope this helps more than it hinders — I can’t help thinking its a bit of a convoluted work-around and there’s a simpler way to do it using the small calendar staring me in the face, I’m not sure.

Last edited by woof (2009-02-18 21:17:33)

Offline

#137 2009-02-18 21:51:08

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

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

woof:

Thank you. So far so good. I need now to play around with it abit, but thanks for the push in the right direction. I will let you know once I have things set.

progre55

Offline

#138 2009-02-19 22:22:12

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

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

Bloke/Rick/Woof/Anyone:

I have an upcoming project that I believe smd_calendar could be perfect for, but I want to see if it would be possible to do what the project requires:

For the upcoming project, it is a Real Estate website. I have built out real estate websites before in TXP so that is not the issue. I know I can easily display the properties, filter information and make everything look sharp and user friendly both front end and back end. The properties are individual articles which should mesh perfect with the plug in.

The niggle in this project is that the properties will be rented and I need to show “on a calendar” the availability (or more appropriately the non availabilty“of the properties.

Here are the items that I am a bit uncertain of:

  • Can I have an individual calendar for each property (article) so that iI can diaplay the article and calendat together, but that it does not show the information for the rest of the properties. I plan on having approximately 100 properties.
  • To maintain the calendar, I need to give the end user the capability of identifying all the dates the property is currently rented. I was thinking of using the skip field, but I want them to be able to span dates because it will be impossible if they have to manually enter every individual date.

Any and all input would be appreciated. My guess is that some of the above are Bloke questions, but I wanted to throw it open to everyone.

Thanks in advance.

progre55

Last edited by progre55 (2009-02-19 22:22:39)

Offline

#139 2009-02-19 23:04:06

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

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

progre55 wrote:

To maintain the calendar, I need to give the end user the capability of identifying all the dates the property is currently rented. I was thinking of using the skip field, but I want them to be able to span dates because it will be impossible if they have to manually enter every individual date.

I started to experiment with an availability calendar a while ago, but haven’t had the time to work on it since. I didn’t even have the time to upgrade the plugin to a more recent version… But I’m just using the posted and expires dates for start and end dates, here is my test page, I still need to add a lot of features before I can actually use it. And I will need more than one calendar as well, though I haven’t thought about how to do that yet.

Offline

#140 2009-02-19 23:58:53

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

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

Given 100 properties, 100 sections with one article assigned to each would be possible. The smd_calender tag is section sensitive by attribute, so it may be possible to use a single page template as well; this would require 4.0.7 TXP or later so as to parse tags as attributes. The alternatives also include filtering by author and category as an organizational option.

Offline

#141 2009-02-20 13:34:54

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

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

Els/Rick:

Thanks for the response. I am hoping Bloke can chime in to give further comment.

Regarding the multiple categories, Rick I was thinking the same thing. Although creating so many sections is not something I would prefer to do, I think that will work, and because the properties will be fixed (ie not changing often) it should only be a one time hastle.

As I thought about it more, the bigger trick to this equation is the “blocking off” of dates. Els posted method, is only effective for a one shot deal. (ie the property is booked next week) The problem is that I need to show that the property is booked 2 weekends in March, three weeks in April, all of June etc. etc. …. I am going to play around a little with the skip field today, but my fear is that it will only allow me to put individual dates which would be almost unmanageable by the end user ….

I will let you guys know when I have a test up on my site to get further feedback and to update you if I discover any findings ….

progre55

Last edited by progre55 (2009-02-20 13:36:25)

Offline

#142 2009-02-20 15:40:48

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

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

Els/Rick/Bloke:

An update:

I can create the calendar as described earlier and mimic the functionality I want.

To do this, I am using one of the fields as the “extra field.”

I now have run into the following issues/question:

  • Can I have the plug in disregard the posted date of the article as being an event date? Reason: I want the current date to be a different color than the event date. Right now, the plug in thinks that the posted date is an event date so it overwrites that class (.today) with the event class (.event) — I know that this is how it is working because if I change the posted date (to a day other than today) I see a different color, but if I add today’s date into the “extra field” I see the event color.
  • As I had expected, the “extra field” works, but it would not be a viable solution because it requires the dates to be entered individually(2/12,2/13,2/14 etc. etc.) …. what I was hoping is that I could put into this field a span and singular dates (2/12 – 2/20, 3,1,3/3 etc.) … I looked at the other field options but did not think they addressed the issue I am coming across … I am hoping I am overlooking something or Bloke (or anyone) has a possible work around ….

Here is the code I am currently using (thanks to woof):

PAGE

<txp:smd_calendar form="cal_S_evform" spanform="cal_S_multis" 
     stepfield="custom_13" omitfield="custom_12" skipfield="custom_13" extrafield="custom_3" 
     classprefixes="" class="smallcal" emptyclass="empty" dayformat="{S,M,T,W,T,F,S}"  monthformat="ABBR" size="large" section="calendar_sample" firstday="1"  /> 

cal_S_evform Form:

<span class="calevent">
<txp:smd_if_cal flag="recur">
  <txp:permlink>(RECUR)</txp:permlink>
<txp:else />
  <txp:permlink><txp:title /></txp:permlink>
<txp:smd_if_cal flag="multifirst">
     <span class="right"></span>
   </txp:smd_if_cal>
   <txp:smd_if_cal flag="recurfirst">
      <span></span>
   </txp:smd_if_cal> 
</txp:smd_if_cal>
</span>

cal_S_multis Form:

<span class="calevent">
<txp:smd_if_cal flag="multi, multiprev"
     logic="or">
   <txp:permlink><txp:title /></txp:permlink>
</txp:smd_if_cal>
<txp:smd_if_cal flag="multilast">
  <txp:permlink title="<txp:title />">
      <span class="left"><txp:title /></span>
   </txp:permlink>
</txp:smd_if_cal>
</span>

Stylesheet:

#calendar {
	margin: 0px auto;
	padding: 0px;
	border:0;
	width: 250px;
         FONT: 8px Verdana,sans-serif; 
	COLOR: #000000;
	TEXT-DECORATION: none;
}
table.smallcal {border-collapse:collapse;border-spacing:0; font-size:10px; width: 100%;}
.smd_cal_navrow {height:25px;}
table.smallcal tr {text-align: left; vertical-align: top;}
table.smallcal th, table.smallcal td {padding: 1px;border:1px solid #FFF; background-color:#8D8D8D; color:#fff; font-weight: bold; text-align:center;font-size:11px; }
table.smallcal td {background-color:#ddd;color:#636F6F; height:25px;}
table.smallcal td.event{background-color:#CC3333}
table.smallcal td.event:hover{background-color:#CC3333}
table.smallcal td.event h4 {color: #fff;}
table.smallcal h4 {color: #999999; margin:0px;font-size:9px;}
table.smallcal .today h4 {color: #fff;}
table.smallcal .today {background-color:#000}
table.smallcal .calevent a {background: url(../images/event_icon.png) no-repeat 3px 0; text-indent: -999em; display:block;}

Thank again for any assistance.

pprogre55

Offline

#143 2009-02-20 17:44:03

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

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

progre55 wrote:

As I thought about it more, the bigger trick to this equation is the “blocking off” of dates. Els posted method, is only effective for a one shot deal. (ie the property is booked next week) The problem is that I need to show that the property is booked 2 weekends in March, three weeks in April, all of June etc. etc.

I am using an article per booking, which shows the availability exactly as you want it (I think). Is there a reason why you couldn’t do that? My setup is now like this:

  • each booking is an article in section ‘calendar’
  • category1 is for provisional/final (you probably won’t need that)
  • category2 is for the appartment-id

Last edited by els (2009-02-20 17:45:57)

Offline

#144 2009-02-20 18:05:00

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

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

Els:

Here is my set up:

  • Each Property is an Article
  • A Custom Field identifies the date the property is booked
  • The other custom fields contain Property Specs (type, price etc.)

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. 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.

Offline

#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

Board footer

Powered by FluxBB