Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#133 2009-02-17 18:55:07

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

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

The event name is a default I believe. You might try wraptags and something that will be seen by the tag as an active value that still allows you to display as you wish.

<smd_calendar>
  &nbsp;
</smd_calendar>

Offline

#134 2009-02-17 21:46:48

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

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

and another option might be to apply a style along these lines:

.calevent a {
background: url(../images/event_icon.gif) no-repeat; 
text-indent: -999em;
}

this would keep the linked event title intact (handy for SEO) but present it as an icon

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

Offline

#135 2009-02-18 13:25:21

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

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

rsilletti/woof:

Thanks for the suggestions, I am just curious on how you are able to get the mini calendar to point to a single areticle.

This is my form code:

<txp:if_individual_article>
<txp:article />
</txp:if_individual_article>
<txp:if_article_list>
<txp:article_custom section="events" form="Single" limit="9999" />
</txp:if_article_list>

Like I mentioned before, the mini calendar outputs a link that looks like this:

http://www.xxxxxx.com/?date=2009-01-24&s=events

rsilletti: I tried your suggestions with no dice.

woof: I may be implementing your suggestion wrong, but in the end at least for this use the mini calendar would be the way to go if I could just get the link to output a single calendar rather than all the events.

Thanks again for the help.

progre55

Offline

#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

Board footer

Powered by FluxBB