Textpattern Forum

You are not logged in. Register | Login | Help

#681 2011-05-04 22:43:22

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,380
Website

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

Bloke wrote:

Anybody see a use for it? Anything I’m missing? Or can I kill it?

I haven’t used it for anything else than maintaining the language marker, so I can’t help you either.


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#682 2011-05-05 10:53:56

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

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

Hi all,

I’ve created an events calendar and would like to implement qtip so that people can quickly read the event details (start date, location, custom fields, etc) within a tooltip negating the need to click through to the full article.

I’ve loaded jQuery and qtip and used the following code in the header:

<script type="text/javascript">
$('ul:event li.smd_cal_standard').qtip({
content: '<txp:title /><br /><txp:custom_field name="Event category"<br /><txp:custom_field name="Event venue"',
show: 'mouseover',
hide: 'mouseout'
})
</script>

My cal_evform is currently:

<txp:smd_if_cal flag="recur,multi,extra">
  <txp:permlink title='Location: <txp:custom_field name="Event venue" /> | Team: <txp:category2 /> | <txp:custom_field name="Tennis League" /> | Time: <txp:posted format="%T" />'><txp:title/>(R)</txp:permlink>
<txp:else />
<txp:permlink class="tooltip" title='<txp:title /> | <txp:custom_field name="Event category" /> | <txp:custom_field name="Tennis League" /> | <txp:custom_field name="Event venue" /> | Starts at <txp:posted format="%H:%M" />'><txp:title/></txp:permlink>
   <txp:smd_if_cal flag="multifirst">
      <span class="right">&laquo;--</span>
   </txp:smd_if_cal>
   <txp:smd_if_cal flag="recurfirst">
      <span>First</span>
   </txp:smd_if_cal>
   <txp:smd_if_cal flag="recurlast">
      <span>Last</span>
   </txp:smd_if_cal>
</txp:smd_if_cal>

Despite reading the qtip documentation I’m not sure how to code this form. It currently display the information in a standard html tooltip but there is quite a lot of information, it’s hard to read and doesn’t seem to accept variables (to ignore empty fields) – hence qtip. As my previous postings show, I struggle with Javascript (time to learn it properly I think) and I’d appreciate any help in putting all the code together.

Offline

#683 2011-05-05 11:20:08

lonelytraveller
Member
From: Firenze, Italy
Registered: 2008-04-04
Posts: 45

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

Hi decoderltd,
I’m using qtip myself to show the details of calendar entries, and even if it’s a bit off-topic (it’s just a matter of finding the right jquery selectors, the qtip community can assist you with this kind of issues), here’s my solution.
First, I wouldn’t use TXP variables inside the script call, but I would play with selectors instead.

My calendar form looks like this:


<txp:smd_calendar section="events" id="mycal" maintain="section,calid" select="month, year::" yearwidth="0,1c"> 
<div class="cal_event">
   <div class="ev_title">
      <txp:permlink>event here</txp:permlink>  <!-- this is what is shown inside the calendar cell -->
   </div>
   <div class="ev_time">  <!-- this is what is shown inside the qtip box -->
      <txp:permlink><txp:title /></txp:permlink>
      Start: <txp:posted format="%H:%M" /><br/>   
      End: <txp:expires format="%H:%M" />
   </div> 
</div> 
</txp:smd_calendar>

Therefore I just tell qtip to show what’s inside the ev_time div when the mouse overs ev_title div. Since you want to do that for every ev_title, you should wrap everything inside a nice ‘each’ function:


$('.ev_title').each(function(){ // Use each to gain access to each element as $(this)
   		$(this).qtip({
      		content: $(this).next('div.ev_time'), // Use the element next to this with class bodytext for the tooltip content
      		hide: {    				 
   				fixed: true,
   				delay: 300, //this allows you to have the time to actually click on the event link
   				when: 'mouseout'
   			}
   			// your other options here
   		})
	});

Offline

#684 2011-05-05 15:24:27

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

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

Hi Catrina,

That’s great, thank you very much for your well commented code. I’m having a couple of problems getting the javascript to take effect but I’ll double check my script links.

On a separate, but associated problem, I’m outputting the contents of some custom fields as part of the event information but it’s causing some rendering problems. It might be the use of apostrophes, for example Ladies' 1st team is rendered as Ladies\' 1st Team' /> and some cases causes most of the event information to disappear (May 5 event) and only displays ' /> – any idea what that might be?

Offline

#685 2011-05-05 15:40:26

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 1,895
Website

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

Ladies’ 1st team

It’s probably being escaped (\’) to prevent the apostrophe breaking the tag. As a quick fix, try writing it with a proper apostrophe, e.g. Ladies’ 1st team.


TXP Builders – finely-crafted code, design and txp

Offline

#686 2011-05-06 10:06:41

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

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

Thanks Jakob, that worked perfectly – must keep an eye for that in future.

Last edited by decoderltd (2011-05-06 10:07:32)

Offline

#687 2011-05-16 19:46:58

saccade
Plugin Author
From: Raubling, Germany
Registered: 2004-11-05
Posts: 458

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

Hi,
I have a problem with spanned events:
I am using customized datefields (for begin and end).

When using showspanned="1" in the current month’s calendar there is a bad effect: spanned-links of future events are shown all over the days.
Starting with the first, then with an end tag on the matching day number of the real events end, but continuing spanned-links to the end of this month.
e.g. now it’s May, in my calendar there is an event from 6th June to 9th in the next month.
Then this month May will show a spanned link from 1st to 8th, then an END-tag link on 9th, but then will continue placing spanned-links on all days to the end of May.

This occurs, if my calendar-section contains events for e.g. the next month in the customized date-fields BUT with a timestamp of this month now.
If I change the timestamp to the same month as the events date, everything seems to be fine.

If there are only events of this month, created/timestamped this month, then it works.

Unfortunately I need both groups of time related data:
customized datefields for begin and end for my events
AND timestamp/expire-fields for controlling publish time of those articles in another place than the calendar.

The effect looks like there is some mixed use of
datefield_begin/dateflied_end
and
timestamp/expire
when showspanned is calculated.

Any help on this?

Best regards
Michael

Last edited by saccade (2011-05-16 19:58:08)

Offline

#688 2011-05-16 22:09:44

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,800
Website

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

saccade wrote:

will show a spanned link from 1st to 8th, then an END-tag link on 9th, but then will continue placing spanned-links on all days to the end of May.

Ack, stupid oversight. Fixed, many thanks.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#689 2011-05-16 22:28:22

bici
Member
From: vancouver
Registered: 2004-02-24
Posts: 468
Website

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

Hoping to use this incredible calendaring plug-in!

Anyone know of a live where it is used in a side nava area ( as a small cal ) linked to visit various full descriptions that appear in the main content area of a web page?

Last edited by bici (2011-05-16 22:31:35)


…. texted postive

Offline

#690 2011-05-16 22:53:00

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,380
Website

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

Like this?


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

Board footer

Powered by FluxBB