Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#613 2011-01-19 23:01:28
Re: smd_calendar: complete schedule / event / calendar / diary
ctruett wrote:
Stef, that worked great.
Cool. Glad it worked.
does anyone know of how to combine two custom fields into a single column in a database?
Not offhand, sorry. glz_cf has a custom script that you could leverage if you know PHP.
a timefields attribute would be excellent for future releases
Yep. It’s already in the next (err, well nextnext now, since the next version is actually going to be a long overdue bugfix) version. The problem being that the version in question has been rewritten from the ground up so it’s a hard slog to the finish line, especially given that I have 3 other unofficial versions out there that I’ve developed in parallel that need merging into the next codebase. I’m not making this easy on myself…
Last edited by Bloke (2011-01-19 23:02:18)
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
#614 2011-01-20 09:36:17
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 553
Re: smd_calendar: complete schedule / event / calendar / diary
I’ve been experimenting a little with {day} {month} {year}
and variables to output different dates when a user changes the day being viewed via calendar. I can get these to display by using the following code and capturing the variables on the destination page:
<txp:smd_if_cal flag="SMD_ANY">
<a href="<txp:site_url />?s=details&date={year}-{month}-{day}&day={day}&month={month}&year={year}">{day}</a>
<txp:else />
{day}
</txp:smd_if_cal>
When they are displayed is it possible when using {month}
to output just the month and not the whole date and is it possible to output a text representation of the month such as Jan? Also when using {day}
is it possible to output it as text such as Tues?
Offline
#615 2011-01-20 09:41:19
Re: smd_calendar: complete schedule / event / calendar / diary
Algaris
Try {monthname}
and {weekday}
. A full list of replacements is available in the docs (if you feel up to wading through them!)
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
#616 2011-01-20 09:45:31
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 553
Re: smd_calendar: complete schedule / event / calendar / diary
Yes sorry I should have had a good look there first. I have been reading through them but sometimes miss things.
Offline
#617 2011-01-22 02:58:53
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: smd_calendar: complete schedule / event / calendar / diary
Stef, I’ve got a simple availability calendar working on an MLP site here. (You can see bookings in April, May and June.)
I’m using the /title URL scheme on this site, so maintain="section,article"
is keeping as well the individual article page as the language marker in the URL in place :) It loses the title in the URL when navigating to another month, but I don’t mind.
At the moment only one apartment is being let, so I won’t need more than one calendar on the page for now; but I assume it will work with multiple calendars as well.
Multiple calendars are still a problem on my test site, where I use the /section/title URL scheme. Navigating only one calendar is fine, but as soon as you switch to the other one, both the language marker and the section are lost. No big deal, I don’t need it now :)
Once again many thanks for your help!
Edit: oops, a couple of validation errors because of the plugin…
Last edited by els (2011-01-22 03:09:34)
Offline
#618 2011-01-22 11:30:35
Re: smd_calendar: complete schedule / event / calendar / diary
Els wrote:
Navigating only one calendar is fine, but as soon as you switch to the other one, both the language marker and the section are lost.
Mmmm, multiple calendars are treading into murky waters a little. I’ve only done rudimentary testing and, unless you start doing clever things like maintaining variables and renaming the y/m/d entries, things start to go sideways very quickly. I’ll see if I can come up with some tests on an MLP site to figure this out (unless you feel comfortable granting me access to your test site so I can do it there?)
I’m pretty sure I still need to allow smd_calendar to honour the language markers in its URL scheme. Been meaning to look at that for ages.
a couple of validation errors
Odd. Can’t figure out why it’s putting the session ID up there on the URL. Will have to look into that. Are you doing anything special in terms of other code on the page that might be putting that up there? I don’t remember using it in the plugin but its been so long since I looked at that part of the code that I may have simply forgotten I put it in there.
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
#619 2011-01-22 17:29:24
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: smd_calendar: complete schedule / event / calendar / diary
Bloke wrote:
I’ll see if I can come up with some tests on an MLP site to figure this out (unless you feel comfortable granting me access to your test site so I can do it there?)
As I said I don’t need it now, so I’m sure you have better things to spend your time on ;) But if/when you really want to have a look, let me know and I’ll send you a login.
I’m pretty sure I still need to allow smd_calendar to honour the language markers in its URL scheme. Been meaning to look at that for ages.
Luckily the plugin thinks the first thing after site.com/ is the section ;) so it works with maintain="section"
and the /title URL scheme.
Odd. Can’t figure out why it’s putting the session ID up there on the URL. Will have to look into that. Are you doing anything special in terms of other code on the page that might be putting that up there? I don’t remember using it in the plugin but its been so long since I looked at that part of the code that I may have simply forgotten I put it in there.
I’ll have a look at my page later today and let you know.
Offline
#620 2011-01-22 17:44:02
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: smd_calendar: complete schedule / event / calendar / diary
I don’t understand why there is a difference in the source input the validator shows:
<tr class="smd_cal_navrow"><th> </th><th colspan="5"><form action="/availability" method="get"><input type="hidden" name="PHPSESSID" value="1327a40b6ef1f66b0cdba5921475e808" /><select name="m" onchange="submit()"><option value="1" selected="selected">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option></select><input type="hidden" value="2011" name="y" /> <span>2011</span><input type="hidden" value="19" name="id" /></form></th><th><a href="/en/?m=2&&PHPSESSID=1327a40b6ef1f66b0cdba5921475e808#38;y=2011&id=19" class="navnext">></a></th></tr>
and what I see when I view the page source:
<tr class="smd_cal_navrow"><th> </th><th colspan="5"><form action="/availability" method="get"><select name="m" onchange="submit()"><option value="1" selected="selected">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option></select><input type="hidden" value="2011" name="y" /> <span>2011</span><input type="hidden" value="19" name="id" /></form></th><th><a href="/en/?m=2&y=2011&id=19" class="navnext">></a></th></tr>
Offline
#621 2011-01-23 00:38:24
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: smd_calendar: complete schedule / event / calendar / diary
Bloke wrote:
Are you doing anything special in terms of other code on the page that might be putting that up there?
Anything in particular that I should look for? I don’t see anything ‘special’ but don’t know how you define ‘special’ ;)
Does a tag trace help you? A list of other plugins?
Offline
#622 2011-02-12 14:31:30
- rmccawl
- New Member
- Registered: 2011-02-12
- Posts: 2
Re: smd_calendar: complete schedule / event / calendar / diary
Hi folks,
I am quite new to txtpattern but I am loving it so far, I have wrapped my head around the coding and snippets, and have
been working on a new portfolio site and blog for myself.
One thing I am having trouble with though is customizing the smd_calendar plugin, what I want it to achieve should be fairly simple, any help would be great.
Ideally i just want it to display the year month and day in the following format , 2011, FEB, 03 and for each day of the month if there is an article posted on that day or articles that the number for that day ie: 03 becomes a link to the article or articles posted on that day.
So far I have managed to get the calendar displaying, I have formatted it into a horizontal line (design choice) and have formatted the month name to display as I need it too. At present tho the articles posted on certain dates appear below the day in a link format showing the article title.
Hopefully someone who has experience with this plugin will know how to edit it to achieve what i want.
Any help would be great
Thanks in advance,
Rory
Offline
#623 2011-02-12 21:55:06
Re: smd_calendar: complete schedule / event / calendar / diary
Anyone had any luck getting smd_calendars to remember the last month viewed via a cookie then use it on the next non-specific calendar view?
That is you navigate around months for a while, go somewhere else. Then on next calendar load, have it return to the last month viewed.
I have successfully written and read back cookies with previous month and year values in urlvars, but when I use the month=“XX” year=“XXXX” the calendar draws but is empty of events.
Any help appreciated.
Offline
#624 2011-02-12 22:28:18
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: smd_calendar: complete schedule / event / calendar / diary
rmccawl wrote:
Ideally i just want it to display the year month and day in the following format , 2011, FEB, 03 and for each day of the month if there is an article posted on that day or articles that the number for that day ie: 03 becomes a link to the article or articles posted on that day.
So far I have managed to get the calendar displaying, I have formatted it into a horizontal line (design choice) and have formatted the month name to display as I need it too. At present tho the articles posted on certain dates appear below the day in a link format showing the article title.
Can you post the contents of the form you are using? (the one that is in form="..."
)
Offline