Welcome Guest, Not a member yet? Register   Sign In
Passing the day value in the url using the calendar class
#1

[eluser]benster[/eluser]
Hi all,

My requirement is to be able to display a calendar (generated by the calendar class) with each day number as a clickable link. Once the day is clicked, the page reloads and I can load events based on the date passed through in the url.

I can easily make each day clickable by changing the calendar template value:

Code:
{cal_cell_no_content}<div class="day_num"><a href="/'.$year.'/'.$month.'/{day}">{day}</a></div>{/cal_cell_no_content}

That then generates me a url similar to:

Code:
domain.com/2010/11/18


The problem is that the calendar then takes the "8" from the date in the url and inserts it into the calendar on the "1" day of the month. Im guessing the calendar class assumes the third parameter is my data array, which in this case it is not, it is my day of the month.

So my question is, can anyone advise a best practice way to pass through the day of the month value using the calendar class within a url without inserting any data in to the calendar?

It seems that the format of /YYYY/MM/DD is not supported using the calendar class, or have i missed something?

Appreciate any thoughts.

Regards, Ben.
#2

[eluser]benster[/eluser]
Yes, I was missing something! If i do not pass in the day as the third param to the calendar, it wont insert it!

Long day Wink

Ben.




Theme © iAndrew 2016 - Forum software by © MyBB