Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#673 2011-05-04 21:14:49

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

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

lonelytraveller wrote:

However the page shows the content in the right language, even if the language segment is lost!!

Yep, that’s right. But it’s not related to smd_calendar, the same thing happens with zem_contact_reborn after sending a message. Still, it’s useful :)

Offline

#674 2011-05-04 21:24:39

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

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

Bloke wrote:

I have no idea why, unless there’s a cookie being set somehow by MLP.

I guess it must be that, because on any page you can manually remove the language marker and keep the right language. So for instance you can remove /en from site.com/en/about/ and the English page is reloaded; remove /nl from site.com/nl/about and exactly the same URL will load the Dutch page.

Sorry, I don’t want to go too much off topic in your thread, but this ‘feature’ is very useful when plugins (like smd_calendar) don’t ‘officially’ work very well with MLP :)

Watch this space…

Will do!

Offline

#675 2011-05-04 21:29:42

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

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

Els wrote:

this ‘feature’ is very useful when plugins (like smd_calendar) don’t ‘officially’ work very well with MLP :)

Indeed it is. Well I’ve fixed the select lists so they now maintain the language marker correctly. That was the easy bit, now for the pesky next/prev arrows. *ponder*


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

#676 2011-05-04 21:45:56

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

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

Bloke wrote:

Well I’ve fixed the select lists so they now maintain the language marker correctly.

Wow, that’s the fastest fix I’ve ever seen.

Offline

#677 2011-05-04 22:04:54

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

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

lonelytraveller wrote:

Wow, that’s the fastest fix I’ve ever seen.

Fastest fingers in the West :-)

BTW, does anybody know if MLP works in messy mode? And if so, what does a typical language-aware URL look like?

site.com/it?s=section&id=297 ?
site.com/?lang=it&s=section&id=297 ?
... ?

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

#678 2011-05-04 22:15:44

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

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

MLP works in messy mode, and URLs look like site.com/en/index.php?s=about. On individual article pages there is no section parameter in the URL (site.com/en/index.php?id=123) though it could of course be added. So not a real language parameter you can work with I’m afraid.

Offline

#679 2011-05-04 22:24:14

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

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

Els wrote:

MLP works in messy mode, and URLs look like site.com/en/index.php?s=about.

Brilliant, thanks. In that case I should be able to fake the /language/ bit if I detect the site is using messy mode.

I’m just wading through the code and trying to figure out what the point of maintain="section" is. It would make it a heck of a lot easier if we didn’t have that option! For the life of me I can’t see what the point of it is, because if you are in an ‘events’ section when you click a next/prev link (or choose a month/year) then by its very nature you must return to the section you are in.

If you were in another section (even the front page) then you would stay in that very same same section too when you navigated the calendar months, regardless of whether you were explicitly maintaining section or not. So I can’t figure out under what circumstances it’s useful. If it turns out it’s not necessary then it makes my job a lot simpler as I can just ditch that bit of code and use the current (possibly MLP-redirected) URL as a basis.

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

Last edited by Bloke (2011-05-04 22:24:24)


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

#680 2011-05-04 22:31:30

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

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

It’s the first time that I’m using smd_calendar, so I can’t help you with that!

Offline

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

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

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.

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

Board footer

Powered by FluxBB