Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#289 2009-05-31 11:40:45
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: smd_calendar: complete schedule / event / calendar / diary
And another issue is puzzling me:
When i filter event articles by their category i get a TXP Tag error notice (in test mode) as you can see here though the output is correct. Shall i simply ignore the error notice?
The code in short hand is:
<txp:if_individual_article>
<txp:article form="#terminArtikelListe" />
</txp:if_individual_article>
<txp:if_article_list>
<txp:if_category>
<h2>Events by Category</h2>
<txp:smd_article_event ... ><txp:title /><txp:body />
</txp:smd_article_event>
<txp:else />
<!-- EVENTS ARTICLE LIST -->
<h2>All Events List for 2009</h2>
<txp:smd_article_event ...><txp:title /><txp:body />
</txp:smd_article_event>
<!-- END OF EVENTS ARTICLE LIST -->
</txp:if_category>
</txp:if_article_list>
Last edited by alexandra (2009-05-31 11:53:41)
Offline
#290 2009-05-31 11:49:18
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: smd_calendar: complete schedule / event / calendar / diary
alexandra wrote:
i get a TXP Tag error notice as you can see here though the output is correct. Shall i simply ignore the error notice?
Alexandra, the notice is only visible because your site is in testing mode. When you set it to ‘live’ it won’t be displayed. Alternatively you can place <txp:article limit="1" pgonly="1" />
somewhere on your page.
Offline
#291 2009-05-31 11:57:34
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: smd_calendar: complete schedule / event / calendar / diary
Hi Els, nice to see yu? How are you doing? Hope fine!
Alexandra, the notice is only visible because your site is in testing mode. When you set it to ‘live’ it won’t be displayed. Alternatively you can place
<txp:article limit="1" pgonly="1" />
somewhere on your page.
I know it only occurs in test mode so still i wondered if it is okay to ignore it. Seems so :) thanks for your answer.
Offline
#292 2009-05-31 12:09:43
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: smd_calendar: complete schedule / event / calendar / diary
alexandra wrote:
Hi Els, nice to see yu? How are you doing? Hope fine!
Very :) Nice to see you back here too.
i wondered if it is okay to ignore it. Seems so :)
I think it’s a notice that causes much confusion. I can’t count the times I’ve typed this same reply ;) It’s only pointing out the fact that there is no article tag, but there are so many uses where no article tag is needed at all, that I’m doubting the usefulness of displaying the notice.
Offline
#293 2009-05-31 19:17:49
Re: smd_calendar: complete schedule / event / calendar / diary
alexandra
Els’ reply is not specific to smd_calendar. The warning pops up in any application where the TXP parser reaches the end of the page and detects no article tag in the flow. This may be — in fact, usually is — for legitimate reasons, the last of which is usually logic in your page!
Mostly it occurs on photography/gallery pages, event lists, client pages where the entire page is protected by ign_password_protect (i.e. when you show the login box for the first time) and so on. As Els implies, it’s a royal pain to have that message show up, even if it is only in debugging/testing mode.
Anyway, to your problem with Example 6. I think some of the issues are to do with your over-use of question marks! The only things you can put question marks in front of are ?month
and ?year
. Those will insert the current month and year. Try removing the ?
chars from in front of the numbers and see if it helps any.
nardo
I’ll get back to you on this. But try smd_article_event for your event lists. It should do what you want.
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
#294 2009-05-31 19:46:46
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: smd_calendar: complete schedule / event / calendar / diary
Bloke schrieb:
Try removing the
?
chars from in front of the numbers and see if it helps any.
Hi Bloke, thank you for answering me on a sunday. Much appreciated. I removed the ?
– though no improvement. I did try a lot before i posted: with and without ?, with feb or february, with offset and without… actually by now i can not think of any combination i did not test.. i did even change single and double qmarks..
smd_article_event contained
from="<txp:smd_cal_now now='01-02-?year' format='%d %B %Y' />" to='<txp:smd_cal_now now="31-?month-?year" format="%d %B %Y" offset="1 month"
BTW i added an article for 15. dec 2008 and this is displayed as well. If i add to from=
only the year like such:
from="<txp:smd_cal_now now='?year' format='%Y' />
or from="<txp:smd_cal_now now='?year' format='%d %B %Y' />
which should list only articles of the current year, i get all event articles from the start on. So i can not set a start time? Correct?
Last edited by alexandra (2009-05-31 20:03:48)
Offline
#295 2009-05-31 21:09:10
Re: smd_calendar: complete schedule / event / calendar / diary
Hi Alex,
try (again) single quotes to surround the tag inside form
attribute (and double quotes for attributes inside txp:smd_cal_now
:
from='<txp:smd_cal_now now="?year" format="%Y" />'
or from='<txp:smd_cal_now now="?year" format="%d %B %Y" />'
Also, check this post to see if what I reported there could be related to this issue.
Offline
#296 2009-05-31 21:13:21
Re: smd_calendar: complete schedule / event / calendar / diary
alexandra wrote:
thank you for answering me on a sunday
Thanks for using my plugin on a Sunday :-)
So i can not set a start time? Correct?
You can set a start time, just not the way you are doing it. To be honest I’m a little confused what you are trying to achieve with the smd_cal_now. Example 6 is very specific in that it is designed to be used when you have a calendar on the same page as the events you wish to list. Thus, if your visitor chooses ‘June 09’ in the calendar, the events alongside on the same page are filtered to only show the ones from June + July 09. As maniqui pointed out, the example should probably have the “01” in the to
field as well, but the essence of the example is the same.
In your case you seem to want to list events from Feb 09 until today + 1 month. That’s cool but I can’t figure out why you are usoing the format parameter in the smd_cal_now
tag: you are not outputting the date for display, you are merely using it as the input to the from
and to
attributes so the format it gives out by default should be fine (emphasis: should!)
Here’s something that works on my server:
<txp:smd_article_event section="news" from='<txp:smd_cal_now now="01-feb-?year" />' to='<txp:smd_cal_now offset="1 month" />'>
<txp:permlink><txp:title /></txp:permlink>
<txp:posted />
</txp:smd_article_event>
That essentially does the following:
- Generates a timestamp of the first of feb this year and inserts it into the
from
attribute — note the single quotes around the entire tag - Generates a timestamp one month from today and inserts it as the
to
attribute — note the lack ofnow
attribute, because it always defaults to the current time - Lists all articles from the ‘news’ section that have Posted dates greater than 01-feb-09 and less than 30 Jun 09 (for today is the 31st May)
The format
parameter is only useful if you are displaying dates to visitors and you wish to use a format other than the one set in your basic prefs. You cannot use the ?
syntax in this, nor any numbers — it adheres strictly to the values in the strftime manual. You should not use it to format a timestamp when inserting dates inside smd_article_event attributes EDIT: See next two posts.
One other thing to remember: the ?month
and ?year
only get their values from the current month and year if there are no m=
or y=
parameters in the URL. If your URL was site.com/events?m=9&y=2008 then the range of articles would go from 1st Feb 08 until 30 Jun 09 (we’re not using ?month
so the fact it is set to september (m=9) is irrelevant).
Does that clear things up at all?
Last edited by Bloke (2009-05-31 22:53:14)
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
#297 2009-05-31 22:13:25
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: smd_calendar: complete schedule / event / calendar / diary
Hi Bloke,
i have a good and a bad news ;) – which one first?
Okay, the bad one is: your code above is not working for me – i def. need to append the format="%d %B %Y"
attribute otherwise i don´t get any output at all.
The good news is: it seems to work now. It´s so late already i did not test it extensively but the following is currently working:
from='<txp:smd_cal_now now="01-jan-?year" format="%d %B %Y" />' to='<txp:smd_cal_now now="01-jun-?year" format="%d %B %Y" offset="1 month" />'
My fault was mixing up all sorts of possibilities: single q, double q, 01 instead of abbrmonthname.. and this format= …
I liked to achieve beeing flexible in filtering the event articles from a certain start time to a future time for an event archive. Ahead of that i iked to know how it works. this pluginis fun though timeconusming.. i have to got to sleep now ..
Thanks again, Bloke you are ver kind – and if you like to test something on my server, you have login
good night to all
Offline
#298 2009-05-31 22:51:02
Re: smd_calendar: complete schedule / event / calendar / diary
alexandra wrote:
i def. need to append the
format="%d %B %Y"
attribute otherwise i don´t get any output at all.
Ah, wait, you’re right. Sorry, if your default date format in basic prefs is set to something that doesn’t look very date-like (e.g. “N days ago”) then you will have to use the format
attribute to make smd_cal_now’s output look more like a conventional date. Sorry for the misleading info, I always forget about it because I set my prefs to use dd Mth YYYY, HH:mn:ss
format.
this pluginis fun though timeconusming..
Ooops, it’s not supposed to be the latter, sorry. The idea was that you start with a very simple tag and build up.
Perhaps if the examples in the help file were correct, and the minical worked properly, and that bizarre bug you found earlier hadn’t been in the plugin, it would have been a better experience for you? If there’s anything you think I can improve — better default options, better documentation, etc — please let me know what can be altered to make it better. I don’t set out to make bad software that sucks all your time away, honest :-)
Last edited by Bloke (2009-05-31 22:54:48)
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
#299 2009-06-01 06:10:44
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: smd_calendar: complete schedule / event / calendar / diary
<txp:smd_article_event section="events" from='<txp:smd_cal_now now="01-?month-?year" format="%d-%m-%Y" />' to='<txp:smd_cal_now now="01-?month-?year" offset="1 month -1 day" format="%d-%m-%Y" />' time="any">
<txp:posted />
<h3><txp:permlink><txp:title /></txp:permlink></h3>
</txp:smd_article_event>
I got this to work by pasting the code snippet into the Txp forum ; ) Seriously, was not working y’day – is working today.
Offline
#300 2009-06-01 07:13:50
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: smd_calendar: complete schedule / event / calendar / diary
Hi Bloke,
sorry, i did not mean to complain – actually i should have added a “ ;) “ – i was more amused than anything else, as it was all about time in my live yesterday and on top i did test a schedule plugin …
I perfomed a quick test with the (obscure) date formats in backend (like hrs ago). As much as i can see now is it works even with hrs ago. still i have to do some more testing …. and i will test nardo´s code above….
Thanks again and happy monday – hope you all have a holiday like we have here in Germany :)
Offline