Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#841 2014-04-02 03:15:00
- Mekajinn
- Member
- From: UK
- Registered: 2014-04-02
- Posts: 24
Re: smd_calendar: complete schedule / event / calendar / diary
Stef… absolutely brilliant plugin this… just a couple of questions… is it possible to link the actual event cell rather than the event text? and also, is it possible to change the date from h4 to some other class?
I’m gonna keep playing anyway, but I found it deceptively easy to style after a little messing around… very nice indeed… excellent work… thank you so much!!!
Offline
#842 2014-04-02 03:28:39
- Mekajinn
- Member
- From: UK
- Registered: 2014-04-02
- Posts: 24
Re: smd_calendar: complete schedule / event / calendar / diary
heh… I’ve found a post about h4… so forget I asked… apologies if the other question has already been asked too.
Offline
#843 2014-05-19 17:01:03
Re: smd_calendar: complete schedule / event / calendar / diary
For a theatre site I have been using a custom field inside <txp:smd_calendar /> with extradays="myCF" to produce a recurring event with a extremely custom schedule.
EXAMPLE: “myCF” contains a series of timestamp encoded dates and time. Let’s say I have 5 instances of “myEvent” three of them are at 7:30pm and two are at 2:00pm.
Using <txp:smd_article_event /> is there any way to display just the particular event time, ie 2:00pm (derived from “myCF”) when displaying a particular instance of that event (the matinee) on a calendar.
As of now <txp:posted /> does exactly what it should and shows the article’s post date. What would be enormous, would be the ability to show the particular time from the timestamp obtained from “myCF”.
Brainiacs?
Offline
#844 2014-05-19 18:29:37
Re: smd_calendar: complete schedule / event / calendar / diary
mrdale wrote #280916:
the ability to show the particular time from the timestamp obtained from “myCF”.
Untested, but if your dates are in a fairly standard, unambiguous format, something like this in your smd_article_event container might get close:
<txp:smd_cal_now now='<txp:custom_field name="myCF" />' format="H:i" />
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#845 2014-07-12 11:38:07
- raminrahimi
- Member

- From: India
- Registered: 2013-03-19
- Posts: 278
Re: smd_calendar: complete schedule / event / calendar / diary
how to remove titles and just have a calendar + link to that event date.
example may be like this: http://cdn.imghack.se/images/b6f0eb36891e852fcf5531345782a47f.jpg
Offline
#846 2014-07-12 21:21:39
Re: smd_calendar: complete schedule / event / calendar / diary
raminrahimi wrote #282089:
how to remove titles and just have a calendar + link to that event date.
Have you tried the size="small" attribute? It’s not as flexible and only allows you to link to one event per day, but might be all you need.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#847 2014-07-13 09:44:14
- raminrahimi
- Member

- From: India
- Registered: 2013-03-19
- Posts: 278
Re: smd_calendar: complete schedule / event / calendar / diary
Yes I need that kind ! but a problem
but now the URL goes something like this: ?date=2014-07-09&s=articles
when i click it shows more articles …
Offline
#848 2014-07-13 09:56:01
Re: smd_calendar: complete schedule / event / calendar / diary
raminrahimi wrote #282097:
now the URL goes something like this: ?date=2014-07-09&s=articles. when i click it shows more articles …
Yes, that’s what the small calendar does. You originally stated you wanted to “remove titles and just have a calendar + link to that event date”. It does that, linking to the landing page for that date. Depending on your Page setup for that Section, you can instruct it to:
- show a list of events (articles) published on that date. This is probably the default if you’re using the
<txp:article>tag. - only show one (the first event?), perhaps allowing visitors to step through all the other articles on that date.
- something else. The plugin help has some examples towards the end of how to ‘read’ the date and do something meaningful with it.
The implementation of what you do when you land on the date page is up to you and your Page template. The calendar just supplies the link.
EDIT: An alternative (and probably something the calendar should offer) is to link to ?month=2014-07-09 which means Textpattern would be put in ‘date mode’. You can build that fairly simply from the large calendar using cellform if you like. If you need a hand, let me know.
Last edited by Bloke (2014-07-13 10:01:24)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#849 2014-12-14 08:46:00
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: smd_calendar: complete schedule / event / calendar / diary
hi,
every time when i click on a ‘next month’ link, the browser jumps at the top of a page and url changes to:
http://www.indiaca.ee/uus/?calid=kalender&m=1&y=2015
http://www.indiaca.ee/uus/?calid=kalender&m=2&y=2015
and so on.
is this normal and should be that way? could i avoid this behaviour somehow? i would like to stop that ‘jumping at the top of a page’ every time i click on a ‘next month’ link – just change the month on a calendar and don’t move anywhere.
code i’m using:
<txp:smd_calendar section="kalender" size="small" firstday="1" dayformat="{P,E,T,K,N,R,L}" monthformat="{Jaanuar,Veebruar,Märts,Aprill,Mai,Juuni,Juuli,August,September,Oktoober,November,Detsember}" time="any" yearwidth="2,1c" id="kalender" />
Offline
#850 2014-12-14 10:34:57
Re: smd_calendar: complete schedule / event / calendar / diary
Gallex wrote #286508:
is this normal
Yes. It calls a new page, so you will experience a refresh.
could i avoid this behaviour somehow?
Yes. You could fetch the calendar navigation clicks via AJAX with a little jQuery (or a plugin).
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#851 2014-12-14 13:24:18
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: smd_calendar: complete schedule / event / calendar / diary
thank’s bloke.
but this task is too much for me…
Offline
#852 2014-12-16 09:01:41
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: smd_calendar: complete schedule / event / calendar / diary
Bloke wrote #286514:
Yes. You could fetch the calendar navigation clicks via AJAX with a little jQuery (or a plugin).
can anybody provide me this little jquery code? cause my (obstinate) client is ready to drop the calendar only because of this “issue”. :(
Offline
#853 2014-12-16 11:19:08
Re: smd_calendar: complete schedule / event / calendar / diary
Gallex wrote #286614:
can anybody provide me this little jquery code?
Certainly. Code is below. Assumptions are:
- You have a recent jQuery loaded on the page.
- You have a div surrounding your calendar called
myCalendar. - You haven’t changed any of the calendar attributes which manage the navigation aspects (e.g. class names, etc).
Put the following code anywhere on your page after jQuery has loaded, except inside your calendar div:
<script>
$(function() {
$('#myCalendar').on('click', '.smd_cal_navnext, .smd_cal_navprev', function(ev) {
ev.preventDefault();
$('#myCalendar').load($(this).attr('href') + ' #myCalendar table');
});
});
</script>
That will simply:
- Intercept any clicks to the calendar’s nav elements.
- Prevent the default click action from firing.
- Call jQuery’s
.load()method using the URL of the nav element (the current page + calendar params), passing it the div from which you want to load the content. When fetched, the content is scanned for the calendar blockmyCalendar, the HTML is extracted and injected into the div on the page that houses the calendar. In this case they’re both the same div, hence the duplication of#myCalendarin the call to.load().
Note it won’t intercept any month/year <select> tags if you have those in your calendar. That’s a fair bit more involved.
Hope that helps.
EDIT: better filter. See here.
Last edited by Bloke (2014-12-16 13:28:35)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
#854 2014-12-16 12:47:56
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,331
Re: smd_calendar: complete schedule / event / calendar / diary
absolutly brilliant, bloke!! thank you!
you can see it in the action here
Last edited by Gallex (2014-12-16 12:48:45)
Offline
#855 2014-12-16 13:27:20
Re: smd_calendar: complete schedule / event / calendar / diary
Gallex wrote #286630:
absolutly brilliant, bloke!! thank you!
No problem. Glad it worked. One thing I just spotted is that jQuery is pulling the full content including the div and injecting it inside the div on the page. That means after the first nav click you get two div containers with the same ID on the page. To combat this, you should alter the .load() call like this:
$('#myCalendar').load($(this).attr('href') + ' #myCalendar table');
By asking it to go and fetch the myCalendar id and then find the table inside, you only get the table returned to you, which is then injected inside the myCalendar div on the page.
Sorry about the mix-up. I’ll amend the post above.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline