Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#856 2014-12-16 14:08:32

Gallex
Member
Registered: 2006-10-08
Posts: 1,331

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

yeah, i noticed that too, but now – no more duplicated div’s.

ps. maybe you should put this (my issue) into the plugin? ;) possible?

Offline

#857 2014-12-16 14:37:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,494
Website GitHub

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

Gallex wrote #286634:

maybe you should put this (my issue) into the plugin? ;) possible?

The main reason I’ve not done it, is because there are a zillion attributes already which weigh the plugin down. So adding more attributes to try and second-guess how people will use the plugin makes it quite tricky to build a universal AJAX system. For example:

  • What container name / id is in use. This is easy if the wraptag / html_id attributes are used, but if you do it outside the calendar plugin, it’s more difficult.
  • Whether you’re going to put more than one calendar per page.
  • Whether you’re going to use select lists for month/year.
  • Whether you’ve reconfigured the classes or manually built header content.
  • Whether you want article content in date cells to also popup without page refresh.

You can see the predicament. That’s why, for the sake of a few lines of jQuery, it’s currently up to site admins to implement any extras like this.

I would like to be able to make it easier for building this kind of thing with the plugin, but I don’t know how it can be done flexibly enough to cover most likely scenarios.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#858 2015-02-28 21:54:40

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

It seems when I click a date the url doesn’t include the m and y attributes, making the calendar go back to the current date, even if I add m and y to the maintain value. Is there another way to make the calendar stay where it was when clicked?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#859 2015-03-01 08:55:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,494
Website GitHub

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

MattD wrote #288661:

Is there another way to make the calendar stay where it was when clicked?

Yes. The maintain attribute is only for when navigating the calendar using the next/prev month links. To add date portions to your URL you need to alter your event anchor to include them, a bit like this:

<txp:smd_calendar section="events">
   <a href="?y=<txp:smd_cal_info type="year" />&m=<txp:smd_cal_info type="month" />"><txp:title /></a>
</txp:smd_calendar>

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#860 2015-03-01 18:06:33

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

Bloke wrote #288664:

Yes. The maintain attribute is only for when navigating the calendar using the next/prev month links. To add date portions to your URL you need to alter your event anchor to include them, a bit like this:

<txp:smd_calendar section="events">...

My issue is with the small calendar.

<txp:smd_calendar size="small" section="events" emptyclass="cal-emtpy" maintain="section,date,m,y"/>

My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#861 2015-03-01 21:06:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,494
Website GitHub

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

MattD wrote #288673:

My issue is with the small calendar.

Then you’ll need to emulate/fake the behaviour of the small calendar using the full-size one. The minical is quite limited in what it can do — it’s just a throwback to this plugin’s roots in mdp_calendar.

There are a few examples dotted around the forum of making a faux minical (that’s one such example, though it’s not complete).


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#862 2015-03-04 19:06:46

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

Sorry to bother but I’m banging my head. How do I get <txp:smd_article_event /> to display a list of events for a specific day, including recurring events?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#863 2015-03-05 23:43:21

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,494
Website GitHub

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

MattD wrote #288753:

How do I get <txp:smd_article_event /> to display a list of events for a specific day, including recurring events?

In theory, for today:

<txp:smd_article_event stepfield="custom_N" time="today">
   <txp:permlink><txp:title /></txp:permlink>
</txp:smd_article_event>

Where N is the custom field number that contains your recurring event definitions.

For specific days, you swap out time="today" for:

from='<txp:smd_cal_now now="yyyy-mm-dd 00:00:00" />'
to='<txp:smd_cal_now now="yyyy-mm-dd 23:59:59"

Of course, the dates themselves can be injected from anywhere: a txp:variable, from the URL via adi_gps, etc…

If that doesn’t work, what have you tried so far?

Last edited by Bloke (2015-03-05 23:47:23)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#864 2015-03-06 01:27:38

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

Bloke wrote #288784:

If that doesn’t work, what have you tried so far?

Finally got it working with your tip. Ended up using this

<txp:smd_article_event 
	stepfield="custom_3" 
	section="events" 
	from='<txp:variable name="article-date"/> 00:00:00'
	to='<txp:variable name="article-date"/> 23:59:59' 
	form="event-article"/>

where article-date is a variable with the format yyyy-mm-dd.

Thanks for your help and the great plugin.

Last edited by MattD (2015-03-10 13:16:34)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#865 2015-03-10 13:14:31

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

Can recurring events have and end time for each occurrence?

Is there a way to set a recurrence for every weekday? (Monday – Friday)

Last edited by MattD (2015-03-10 13:33:24)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#866 2015-03-10 14:43:53

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,494
Website GitHub

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

MattD wrote #288921:

Can recurring events have and end time for each occurrence?

Yes, set the article’s expiry date, either using the built-in field, or nominate a custom field to handle article expiry (see datefields).

Is there a way to set a recurrence for every weekday? (Monday – Friday)

Yes of sorts. I’ve partially implemented a shorthand syntax for date ranges, but I don’t think it works on stepfields. But you can use it in omitfields, by setting up your article like this:

  1. Publish date: start of event
  2. Expiry date: end of event
  3. Recur custom field (stepfield): 1 day
  4. Omit custom field (omitfield): {Sat:Sun}

That’ll schedule the event every day between article start and expiry, except Saturdays and Sundays.

There are probably alternatives, but I can’t think of any neater ones off the top of my head.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#867 2015-03-10 15:21:06

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

Bloke wrote #288925:

Yes, set the article’s expiry date, either using the built-in field, or nominate a custom field to handle article expiry (see datefields).

I think I’m ok since I really only need the end time but the expiry date ends the recurrence of the event as well right?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#868 2015-03-10 15:39:16

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,494
Website GitHub

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

MattD wrote #288929:

the expiry date ends the recurrence of the event as well right?

Yes, it ends the entire event so the recurrence ends along with it. The downside being the article is no longer available to view on the site (unless you’ve got Publish expired articles set in prefs). That’s why I added datefields so you could “end” an event and still have the article available on the site, because article expiry is then a separate entity.

Interestingly enough, an event with a start and expiry and no recurrence is termed a spanned event because it spans a date range. So another way to do your scenario above without recurrence is to just use article publish and expiry (or configure some datefields), set the extreme start and end dates of your event (which will, by design, make it recur “every day”), then use omitfield in the same way as earlier to remove {Sat:Sun} from the mix. I like to provide more than one way to skin a nut, or crack a cat, or whatever.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#869 2015-03-19 05:58:17

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

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

Think this is my last issue…

Timezones seem to be affecting events displaying. Server TZ is “America/Chicago” and Time Zone is America/Los_Angeles. Event’s with a posted date before 1:00 AM using below code do not display with a url containing the date of the article posted date such as 2015-03-23.

<txp:variable name="article-date"><txp:rah_function call="gps, htmlspecialchars" name="date" /></txp:variable>
<txp:smd_article_event 
	stepfield="custom_3" 
	section="events" 
	from='<txp:variable name="article-date"/> 00:00:00'
	to='<txp:variable name="article-date"/> 23:59:59' 
	form="event-article" omitfield="custom_5"/>

My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#870 2015-09-16 18:37:39

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 252
Website

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

Hello, I can’t manage to print anything in my little cells, here is the code

<txp:smd_calendar class="bigcalendar" 
    firstday="1" 
    section="appuntamenti" 
    datefields="custom_1" // tried also data_evento but no
    wraptag="div"
    dayformat="Dom,Lun,Mar,Mer,Gio,Ven,Sab"
monthformat="Gennaio,Febbraio,Marzo,Aprile,Maggio,Giugno,Luglio,Agosto,Settembre,Ottobre,Novembre,Dicembre">
      1 // does not print 
</txp:smd_calendar>

Thanks!!!

Offline

Board footer

Powered by FluxBB