Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#793 2012-02-21 20:47:19

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

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

GugUser wrote:

How could I publish the event article with the current date but set in the expires date when it takes place, so that the event link in the calendar get to the article?

If I’ve understood correctly, I think you’ll need the datefields attribute (see the post above yours for some important information about datefields).

Proceed like this:

  1. Set up two custom fields to hold a start date and an end date. These are the dates of your actual event
  2. In your article for the event, set the two date fields to the appropriate (future) start and stop date of the event (in YYYY-MM-DD format)
  3. Set the Posted date of your article to be now, or whenever you want the article to appear in the usual Txp article flow
  4. In your smd_calendar tag, make sure to include datefields="custom_X, custom_Y" to tell the calendar to read the start and end dates from the nominated custom fields

Then your article appears now and you can promote the event in advance of it actually appearing on the calendar.

Does that help?

Last edited by Bloke (2012-02-21 20:49:03)


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

#794 2012-02-21 21:02:35

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

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

Thank you Bloke for your immediate response. If possible I would prefer a solution with the existing date fields. I had tried that before with datefields="" showspanned="0" or with extrafield="write-expires" showspanned="0", but it remains the starting date (the events are one day events).

Is it impossible that the calendar uses only the expiration date?

Offline

#795 2012-02-21 21:20:49

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

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

GugUser wrote:

I would prefer a solution with the existing date fields.

Hmmm, not immediately easy to do that because Txp will only show articles in a feed when they reach Posted date.

The only other way I can think of (which is unfortunately messy) is to have two articles: one in an ‘events’ section which has Posted/Expiry set to when you want the event to appear on the calendar in the future. Use section="events" in smd_calendar to only include these articles.

Then write a second article in your regular section which is sent to your RSS feed and reference the other article in it via a permlink or use <txp:article_custom> to pull in details from the article in the events Section into your “about the upcoming event” article.

Past that I don’t think it’s possible. The expiration date is the date the event expires and its role in the calendar can’t be altered.

Last edited by Bloke (2012-02-21 21:22:42)


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

#796 2012-02-21 21:29:29

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

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

Thank you very much. So I’ll decide between my current solution and one with a custom field. The two article solution I don’t like particularly.

Thank you again for your great support for Textpattern and his users.

Offline

#797 2012-02-21 22:56:37

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

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

The datefields="custom_X,custom_Y" solution don’t work for a one day event. If I use datefields="custom_6,custom_6" then the calendar displays no event. I opted my first version without the RSS feed.

Another idea would be with a spanned event between the post date and the expires date. How could I prevent the “multifirst” and “multi” output and show only “multilast”?

Offline

#798 2012-02-21 23:06:27

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

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

GugUser wrote:

If I use datefields="custom_6,custom_6"

If you tell the plugin that the start date (bear in mind the ‘time’ part of the date will be set to midnight) is exactly the same date+time as the end date then the calendar will not show it. If you’re using expiry, datefields must (currently) be a discrete pair of fields.

If you use the same custom field, what you are effectively saying is this:

  • My event starts on 21 Feb 2012 at 00:00:00
  • My event ends on 21 Feb 2012 at 00:00:00

Thus, there is “no time” between the two dates and the event does not show.

How could I prevent the “multifirst” and “multi” output and show only “multilast”?

Sorry, I’m not sure I understand what you’re trying to achieve. The flags are just notifications and classes assigned to events/cells so you can perform conditional logic and style things accordingly.

A spanned event is one that has more than 24 hours between its start and end dates. It might be one second more than 24 hours, but it needs to exceed 86400 seconds to qualify as a spanned event.

Last edited by Bloke (2012-02-21 23:07:05)


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

#799 2012-02-21 23:56:52

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

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

A spanned event is one that has more than 24 hours between its start and end dates. It might be one second more than 24 hours, but it needs to exceed 86400 seconds to qualify as a spanned event.

Excuse me if I was not clear enough. With “spanned event” I wanted to write from a different option using the posted date (21 Feb) and the expires date (29 Feb) from the article. In this version, the calendar shows all fields between the 21 and 29 as event. But I just want the 29 (multilast) styled and linked as event. The styling is easy to change, but I would not link to the article in “multifirst” and “multi” flagged fields. For that reason I asked how can I prevent the output of the links in “multifirst” and “multi”.

Sorry, my English is not good. I hope I have now better explained the idea.

Offline

#800 2012-02-22 00:34:26

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

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

GugUser wrote:

how can I prevent the output of the links in “multifirst” and “multi”.

You’ll need to build your own cells using cellform. Maybe something like this:

<txp:smd_calendar size="small" firstday="1" id="cal-events"
     section="events" expired="0" cellform="calendar-cells" classlevels="cellplus" />

And in Form calendar-cells:

<txp:smd_if_cal flag="multilast">
   <h4>{events}</h4>
<txp:else />
   <h4>{day}</h4>
</txp:smd_if_cal>

That’s not perfect but it’ll only display an event link on the last day of multi-spanned events.

Last edited by Bloke (2012-02-22 00:34:56)


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

#801 2012-02-22 01:36:09

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

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

This ist great, it works! Even with two events. Many thanks.

The interesting part of the calendar code is:

<tr>
	<td><h4>20</h4></td>
	<td class="smd_cal_event smd_cal_multifirst"><h4>21</h4></td>
	<td class="smd_cal_event smd_cal_today smd_cal_multi"><h4>22</h4></td>
	<td class="smd_cal_event smd_cal_multi"><h4>23</h4></td>
	<td class="smd_cal_event smd_cal_multi"><h4>24</h4></td>
	<td class="smd_cal_event smd_cal_multi"><h4>25</h4></td>
	<td class="smd_cal_event smd_cal_multi"><h4>26</h4></td>
</tr>
<tr>
	<td class="smd_cal_event smd_cal_multilast"><h4><span><a href="/?date=2012-02-21&s=events">27</a></span></h4></td>
	<td class="smd_cal_event smd_cal_multi"><h4>28</h4></td>
	<td class="smd_cal_event smd_cal_multilast"><h4><span><a href="/?date=2012-02-22&s=events">29</a></span></h4></td>
	<td class="smd_cal_empty">&nbsp;</td>
	<td class="smd_cal_empty">&nbsp;</td>
	<td class="smd_cal_empty">&nbsp;</td>
	<td class="smd_cal_empty">&nbsp;</td>
</tr>

So I can style .smd_cal_multilast.

Offline

#802 2012-02-27 20:42:30

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

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

hello stef, hello forum,

i’m currently planning the website for a major arts festival with about 90 exhibitions in three month. i would like to use textpattern together with smd_calendar plugin for this.

i’ve started with a section “exhibitions” on which i list my events with <txp:smd_article_event section="exhibitions" /> – works fine. but i would like to filter the eventlist and this where i stuck. this is the filtering i would like to establish:

a select list for filtering the events with the following features:

  1. show all events that start today
  2. show all events that finish in one week
  3. clear the list and return to display all events

i’ve read very carefully through the advise stef gave teemu in this forum post, but was seeking for a solution without custom fields (to ease my clients life). following the advise, i set up a form with <option value="<txp:smd_cal_now format="%Y-%m-%d" offset="1 week" />">Eine Woche voraus</option>. this indeed gave me the date i wanted (today + one week) in a variable “date”. i plugged this returning variable via adi_gps into smd_article_event: <txp:smd_article_event section="exhibitions" to='<txp:variable name="date" />'>. but this lead to nothing as both tag attributes (from and to) only accept “posted” but not “expires”.

so, this is my question: what would be the best way to set up such a filtering? ain’t there no solution without custom fields? do i overlook something very obvious and easy?

as you might see from this post, i have very, very limited coding and php skills. so i apologize if this seems to be a silly question.

thanks in advance for pointing me in the right direction, christoph

Offline

#803 2012-05-16 17:08:32

photonomad
Member
Registered: 2005-09-10
Posts: 290
Website

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

Totoff, did you ever find a solution to your question about filtering?

Offline

#804 2012-05-16 17:18:50

totoff
Member
From: Cologne, Germany
Registered: 2011-04-04
Posts: 145
Website

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

hi fotonomad,

yes and no. i found a solution without smd_calendar that displays information on how long an exhibition will run or – if so – says that it is already expired.

inside article_custom i use:

<div class="four columns omega exlist column_2">
  <txp:if_expired>
    <p class="expired">Leider bereits vorbei.</p>
    <txp:else />
    <txp:uli_if_expires_in days="07" hours="00" minutes="00">
      <p>Nur noch bis <b class="expires"><txp:expires format="%d.%m." /></b></p>
      <txp:else />
      <p><b><txp:posted format="%d.%m." />&ensp;bis&ensp;<txp:expires format="%d.%m." /></b></p>
    </txp:uli_if_expires_in>
  </txp:if_expired>
  <p><txp:custom_field name="Galerie" /></p>      
</div> <!-- exlist column 3 -->

i think i could develop this further to a navigation as i originally indented, but i got occupied by other jobs and haven’t followed this route.

you can see this code live on a page that is still under development: http://dev.photoszene-koeln.de/ausstellungen/

hope that helps!

p.s. thanks to uli who has contributed uli_if_expires

Offline

Board footer

Powered by FluxBB