Textpattern CMS support forum

You are not logged in. Register | Login | Help

#611 2011-01-19 12:11:49

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,566
Website

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

wornout wrote:

Maybe cellform replacement variables works only with <txp:smd_calendar /> and not with <txp:smd_article_event />?

Ah, yeah, you’ll need to use <txp:smd_cal_info /> to grab the relevant date portions. Sorry for the bogus info.


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

#612 2011-01-19 22:52:06

ctruett
New Member
Registered: 2011-01-18
Posts: 4

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

Stef, that worked great. I have my events listing on the correct days like they should now. Thank you again for your help.

On a side note, does anyone know of how to combine two custom fields into a single column in a database? I’d like to combine the results from my date picker and time picker into a single new custom field, so that I can get the times working with smd_calendar.

Stef, I don’t know if you have already had this requested, but a timefields attribute would be excellent for future releases. Thanks for the great plugin!

Offline

#613 2011-01-19 23:01:28

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,566
Website

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: 435

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,566
Website

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: 435

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
Admin
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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,566
Website

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
Admin
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
Admin
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>&nbsp;</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>&nbsp;</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

Board footer

Powered by FluxBB