Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#373 2009-10-01 03:50:15

assaultonaudio
Member
From: Montreal
Registered: 2009-09-03
Posts: 11

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

Hey Stef,

Thanks a lot for your response!

I tried out your suggestions and didn’t get any closer to a solution…I’m currently using the maintain attribute to keep the right article showing when selecting next or previous on the calendar.

I actually just noticed something in the help file…

:nameval : add your own name/value pairs to the calendar’s URL. e.g. nameval=“tracker=mycal, keep=1” would add ?tracker=mycal&keep=1 to the URL. Useful if you want to maintain some values which you can’t add to the URL on page load

Could I use this to keep the calendar’s url for the given month to remain on that month when selecting to view one of the events?

Cheers

Offline

#374 2009-10-01 16:56:02

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

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

assaultonaudio wrote:

I’m currently using the maintain attribute to keep the right article showing when selecting next or previous on the calendar.

Ah, right, I thought you were trying to maintain the calendar’s currently displayed month when an event from within the calendar was clicked. That’s what my previous post did. What you want here is the other way round. i.e if on an individual article and you click Next on the calendar, the current article remains in view, right?

If that’s the case, it should do it automatically if your page logic is right. Because when you click Next/Prev on the calendar it just adds the m= and y= vars to the current URL. Thus, site.com/section/my_article becomes site.com/section/my_article?m=11&y=2009 if you click Next, and the current article remains in view.

If it’s not behaving that way, please let me have some more details of your calendar tags, general page layout and your permlink mode and I’ll investigate.

Could I use [nameval] to keep the calendar’s url for the given month to remain on that month when selecting to view one of the events?

I don’t know. It’ll depend how you’re calling the smd_calendar tag. And how persistent you want that current month to be. For example, my previous post should work to add the current month and year to all events clicked from inside the calendar itself. If it doesn’t, please post your tag so someone can take a look at your logic. If you want the calendar to maintain its user-selected month when navigating article next/prev links you’ll need something like smd_horizon.


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

#375 2009-10-01 17:06:38

assaultonaudio
Member
From: Montreal
Registered: 2009-09-03
Posts: 11

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

Hey Stef,

Thanks again for the response.

I think you got in on the very last sentece actually :)

I’m trying to make it so when you select different month than today, ie December, and you navigate elsewhere on the site, that December stays as the selected month. You can see how it’s currently working at www.hemispheregauche.com/hg_textpattern

My calendar form incredibly simple right now :

<txp:smd_calendar section=“calendar” size=“small” time=“any” gmt=“0” yearwidth=“4” firstday=“1” maintain=“section, pg”/>

This works perfectly to maintain the current article or page the user is on, but it is exactly the opposite I want as well..keep the calendar month no matter where the user decides to go.

I do currently have smd_horizon installed. I’m going to check it out right now and see if it can help me.

Cheers

Offline

#376 2009-10-01 17:18:45

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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

assaultonaudio: I think you may need to begin thinking about implementing a solution using cookies to keep/save the last selected (by visitor, of course) month/year on the calendar, no matter where the visitor clicks.
Let’s see what Doctor Bloke has to say!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#377 2009-10-01 17:21:16

assaultonaudio
Member
From: Montreal
Registered: 2009-09-03
Posts: 11

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

Thats a good idea maniqui.

Added to the list of things to look into.

Cheers!

Offline

#378 2009-10-02 06:10:14

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

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

OK … I need some help with this! I use this great plug-in as follows:

<txp:smd_article_event stepfield="custom_1" omitfield="custom_2" time="future" wraptag="table" limit="999" break="" section="agenda" eventlimit="52">
   <txp:if_different>
      	<tr>
        <th colspan="4"><txp:posted format="%B %Y" /></th>
     </tr>
   </txp:if_different>
     <tr>
         <td><txp:posted format="%d" /></td>
         <td><txp:posted format="%a" /></td>
         <td><txp:title /></td>
         <td><txp:posted format="%H:%M" /> uur</td>
         <td><txp:custom_field name="agenda_mededeling" /></td>
     </tr>  
</txp:smd_article_event>

Well, as you can see the page is far too long!

Is it possible to show only the first two months from now? Or is it possible to make this page into several pages? I don’t know where to begin, so please give me a push … :)

Last edited by RedFox (2009-10-02 06:12:30)

Offline

#379 2009-10-02 06:35:28

LetterHoofd
Member
From: Kortrijk, BE
Registered: 2006-01-20
Posts: 40
Website

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

You could change the limit (now 999 total). And/or change the eventlimit (now 52 repetitions).
Or have a go with the month attribute (txp:variable might be useful to display this month and the next).

Offline

#380 2009-10-02 08:15:25

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

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

RedFox wrote:

Is it possible to show only the first two months from now?

Couple of ideas. Firstly you could try the to attribute:

to='<txp:smd_cal_now now="?month-?year" offset="2 months" />'

Or you could use paging (offset attribute) because — unlike article_custom — smd_article_event can use ?pg= URL variables. Just watch out if you’re displaying other articles on the same page because both will be affected by the pg variable.


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

#381 2009-10-05 08:42:43

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

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

Bloke wrote:

to=’<txp:smd_cal_now now=”?month-?year” offset=“2 months” />’

Thanks Bloke! To understand this kind of code, does this mean: to= show no months at all except the first two … ?

Offline

#382 2009-10-05 08:45:56

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 809
Website

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

Bloke wrote:

Or you could use paging (offset attribute) because — unlike article_custom — smd_article_event can use ?pg= URL variables. Just watch out if you’re displaying other articles on the same page because both will be affected by the pg variable.

Can you please push me harder … I’m not a code dev … :( … how precisely do I use paging with smd_article_event … ?

Last edited by RedFox (2009-10-05 08:50:07)

Offline

#383 2009-10-05 08:52:15

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

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

RedFox wrote:

does this mean: to= show no months at all except the first two …

No. from and to specify a range of dates that the smd_article_events tag will show. Anything inside these dates will appear. We didn’t need a from attribute in this example because you’ve chosen time="future" which automatically excludes anything before today’s date, i.e. from is automatically set to ‘today’.

How precisely do I use paging with smd_calender … ?

Exactly the same way you do it with standard TXP articles. The txp:older and txp:newer tags will page through the results if you set smd_article_events to use paging="1" and use the limit attribute to only show N items per page. offset allows you to not start at the beginning in exactly the same way it works with standard articles.


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

#384 2009-10-05 16:28:16

molly
Member
From: Virginia
Registered: 2004-08-15
Posts: 44
Website

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

Hi Stef –

I have the latest version of your plugin (v 0.42c) running on this page:
http://www.beerrun.com/tasting-events-calendar

And I have 3 articles with a stepfield set up with “second sunday ?month ?year”, same goes for the third and fourth Sundays.

Something is wrong with November. The first Sunday is Nov. 1, but the articles are off by one week. The software seems to be missing the fact that November 1 is a Sunday.

What can I do about this? Thanks in advance!

Offline

Board footer

Powered by FluxBB