Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#661 2011-04-12 15:06:03

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

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

Bloke:

Unfortunately, the difficulty I am having is with maintaining the currently viewed month. That is where I am now faultering. I have the calendar and article in seperate columns on a page. The calendar is defaulted to the current month (April). If the visitor is looking at future events by clicking to another month and selects an event in that future month, the event shows, but it resets the calendar back to the default month (April). I thought maybe I would be able to pull some data from that article and tack it on to the end of the url string, but the problem is that some of the events span a long time period.

Any thoughts would be appreciated since cellforms are a bit foreign to me. I would also be willing to format the page, but all things I have tried have delivered the same result.

Thanks.

progre55

Offline

#662 2011-04-12 22:05:04

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

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

Bloke wrote:

I’m still trying to track down / replicate your multi-calendar thing.

Stef, if it’s any consolation, I can’t reproduce it anymore… I am sure I didn’t dream it, I now regret that I didn’t make a screenshot to prove that I’m not losing my mind. But I’ve been working 13 hours today and maybe I’m overlooking something. I still have a database backup from before the upgrade, so when I have time again I can try and repeat what I did. But for now, please forget about it. Sorry for wasting your time!

Offline

#663 2011-04-27 11:53:44

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

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

Hello, I’ve just installed smd_calendar on a textpattern (4.2.0) install running MLP. I’ve read in a previous post by Els that MLP and smd_calendar can work together, so I’m trying to build a very basic event calendar. I’m using a section/title url scheme.
My problem is that I can’t get the ‘previous month’ and ‘next month’ links to work, everytime I click on the arrow I get a 404 page. I’ve tried using ‘dirty’ URLs but I get the same result. What am I doing wrong?
I’m using a very basic calendar tag inside my ‘events’ page template:

<txp:smd_calendar section="events" > 
<div class="cal_event">
   <div class="ev_title">
      <txp:permlink><txp:title /></txp:permlink>
   </div>
   <div class="ev_time">
      Start: <txp:posted format="%H:%M" /><br/>   
      End: <txp:expires format="%H:%M" />
   </div> 
</div> 
</txp:smd_calendar>

The ‘previous month’ link generates this kind of URL: http://localhost/en/?m=3&y=2011 which returns a 404 page instead of the events page template (is it the template that is supposed to show up?). However the link generated by the permalink points to the right page and the calendar seems to work.
I’m probably doing some obvious mistake, but I’ve spent hours trying to solve this problem without getting any further, so any help would be much appreciated.

——-
Edit: I did some more testing, and using select="month, year:<:>" works. Basically the “select” field generates the right url, that is http://localhost/mysite/events/?m=5&calid=mycal but the ‘next’ and ‘previous’ links that still appear beside the select field, generate the wrong url without ‘mysite’ and ‘events’ segments.
However if I add the yearwidth="2c", then the generated url is http://localhost/mysite/?m=4&y=2011&calid=mycal and as you can see the ‘mysite’ segment is still there, but the ‘events’ segment is missing… what’s going on??

After some more testing my code now looks like this:


<txp:smd_calendar section="events" id="mycal" maintain="section, article, calid" cellform="cellform" select="month, year:<:>" yearwidth="2c"> 
<div class="cal_event">
   <div class="ev_title">
      <txp:permlink><txp:title /></txp:permlink>
   </div>
   <div class="ev_time">
      Start: <txp:posted format="%H:%M" /><br/>   
      End: <txp:expires format="%H:%M" />
   </div> 
</div> 
</txp:smd_calendar>

Last edited by lonelytraveller (2011-04-27 15:24:58)

Offline

#664 2011-04-29 02:03:42

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

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

Running 0.50 on TXP 4.4.0. Odd issue with small calendar. Instead of hyperlinking the day number as documented, it produces this HTML:

<td class="smd_cal_event"><h4>7</h4><span class="smd_cal_standard smd_cal_ev_category-name"> href="http://buzz.kevinpottsdesign.com/2011/05/07"</span></td>

When I tell the small calendar to instead render events as a form, everything works perfectly. However, the default behavior seems off. I can of course mimic a small calendar with a modified large calendar, but I thought I would at least note what I think might be a bug.


Kevin
(graphicpush)

Offline

#665 2011-05-02 21:19:26

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

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

kevinpotts wrote:

I thought I would at least note what I think might be a bug.

Confirmed bug with my code refactorisation attempt at trying to phase out duplicate code. A couple of stupid oversights on my part led to bogus output during rendering the minical-which-is-now-a-fake-large-cal-in-the-code.

Thanks for spotting it; fixed in the upcoming v0.51.


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

#666 2011-05-02 21:24:55

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

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

No problem. I’ve put together a passing hack for the time being with a form and a bit of jQuery. All good; as always, thank you for the monumental effort.


Kevin
(graphicpush)

Offline

#667 2011-05-02 21:55:41

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

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

lonelytraveller wrote:

everytime I click on the arrow I get a 404 page.

That is strange. Although I’ve not tried it with MLP in anger, I suspect the problem is that MLP is rewriting the URL to include the /en/ (or whatever language) then my plugin marches in and mistakenly thinks the language marker is the section in section/title permlink mode, and gets itself in a right pickle. Note to self: figure out a way to make the plugin play better with MLP’s URL structure.

For the time being it looks like you’re jumping through every hoop in the book to spank the plugin into submission. Quite why it’s still ‘forgetting’ part of the URL is unclear and I can’t replicate it without installing MLP on my test box. Perhaps Els can shed some light on possible avenues of exploration, as she’s the most experienced person I know who is combining the two systems.

Is the site in question online and in development (i.e. not live right now)? If so, would you mind letting me have a login so I can play at trying to make the calendar behave? That’d speed things up for me, but I’ll need to throw some debug info to the screen so it’s easier if the site isn’t in use by customers! Many thanks.


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

#668 2011-05-02 22:59:08

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

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

Bloke wrote:

Perhaps Els can shed some light on possible avenues of exploration,

Well, probably the only reason why the two more or less work together on my site is that I’m using the /title URL scheme. smd_calendar sees the language marker in the URL as the section, so I can use maintain="section,article". For some reason when using the dropdown month selector it loses the language marker, so I’m only using the prev/next navigation.

Offline

#669 2011-05-04 17:40:00

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

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

Bloke, Els: sorry for being late in replying to your post, even if I subscribed this thread for some reason I didn’t receive any notification and since I was working on another project I didn’t check for updates.

Bloke wrote:


Is the site in question online and in development (i.e. not live right now)? If so, would you mind letting me have a login so I can play at trying to make the calendar behave? That’d speed things up for me, but I’ll need to throw some debug info to the screen so it’s easier if the site isn’t in use by customers! Many thanks.

I’d be more than happy to let you ‘play’ with my install, I’ve just put on-line a test version of the website, I’ll PM you the login details so you can have full access. As you will see, for the moment I’m just using the “select” option, just to show my client how the calendar should work, but I’d prefere to use the other solution.

Els wrote:


Well, probably the only reason why the two more or less work together on my site is that I’m using the /title URL scheme. smd_calendar sees the language marker in the URL as the section, so I can use maintain=“section,article”. For some reason when using the dropdown month selector it loses the language marker, so I’m only using the prev/next navigation.

So the ideal solution would be to have a “lang” variable that should be added to the ‘maintain’ parameter?

Offline

#670 2011-05-04 18:56:50

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

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

lonelytraveller wrote:

So the ideal solution would be to have a “lang” variable that should be added to the ‘maintain’ parameter?

Hmm, interesting idea. I don’t see how you could get that to work though, since adding lang=en to the URL doesn’t seem to do what /en/ does… And that’s the only thing maintain does, keeping parameters in the URL, right?

Or did you have something else in mind, Caterina?

Last edited by els (2011-05-04 18:57:21)

Offline

#671 2011-05-04 21:04:47

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

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

It was just an idea, I just thought that if that “en” or “it” or any language prefix could be passed somehow to the url, than we could probably use it somehow (maybe with some kind of really clever .htaccess URL rewrite?). But I’m more a front-end developer, so it could be just a bad idea.

However the problem is indeed with the language segment rewrite. When I use the dropdown month selectors the calendar works even if the lang prefix is lost: let’s say I’m on the page mysite.com/en/events and I choose to jump to the July calendar, so I select ‘July’ from the dropdown and I get the following URL mysite.com/events/?m=6&y=2011&calid=mycal
However the page shows the content in the right language, even if the language segment is lost!!

Offline

#672 2011-05-04 21:11:45

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

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

lonelytraveller wrote:

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

Thanks for the login info. Yes I just noticed that too. Very bizarre indeed! I have no idea why, unless there’s a cookie being set somehow by MLP.

Either way, the next/prev arrows are indeed interpreting the language marker as the section so there clearly needs to be some cleverness inside smd_calendar to render correct URLs. And whatever I come up with I shall also apply to the select lists. Watch this space…


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