Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2014-10-23 14:14:30

Derekstaff
Member
Registered: 2014-10-23
Posts: 28

Google Calendar support

Hi! First time trying to work with TXP. I’m trying to create a website for a small organization. One of my big goals is to create a site that can pull content from a pre-existing Google Calendar for the organization. I’d like it to be able to pull theme and goal of the month for the organization to display on the homepage, and to list the next week’s upcoming events. I found plugins for displaying a Google Calendar, but just displaying the calendar is not what I want. Have I missed something? Is there a way up do this?

If that proves infeasible, we can enter the info into TXP separately as pages. If I do so, is there a way to display that content by event date, as opposed to published date?

Thanks for any help!

Offline

#2 2014-10-23 14:58:36

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: Google Calendar support

Have you looked at mka_ical? Note: The download link is broken but the source code is available.

Offline

#3 2014-10-23 15:24:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,271
Website GitHub

Re: Google Calendar support

michaelkpate wrote #285089:

mka_ical

Woah, that’s one complicated plugin to install! Not like the usual copy-n-paste-n-click we’re used to. It requires FTPing the library files to the server and bypassing Txp’s plugin system, unless you’re willing to compile mka_ical.php into a Txp plugin using the plugin composer. Even then, you still have to upload the library files and include them from PHP. Probably does what you want, but it’s a bit messy :-(

Displaying a calendar from information stored in Textpattern articles can be achieved with smd_calendar, but it’s not much use for importing content from external sources. It can spit data out in whatever format you like though (see Example 5 in the help text for exporting iCal data).

Alternatively, if you can get a (XML?) feed of the event data from Google Calendar, you could use a plugin such as smd_xml or etc_query/smd_query to import it into your Textpattern database and then display it using smd_calendar’s tags. Or maybe, if we’re clever, import the data on-the-fly using smd_xml and use that to display the events directly on the page. Or perhaps fool smd_calendar into using that data instead of what’s in the database.

Not sure if the plugin’s up to that at the moment, but it’s the sort of thing it ought to be able to do, so if that’s what you’d like to do I could look into it.


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

#4 2014-10-23 16:14:54

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: Google Calendar support

Parsing google calendar XML feed points to coreylib which looks like it might or might not be useful.

Or perhaps GCalPHP

Or Calendar Code which includes the code but the example doesn’t work.

Offline

#5 2014-10-23 17:12:08

Derekstaff
Member
Registered: 2014-10-23
Posts: 28

Re: Google Calendar support

Thanks for the ideas. I’m pretty new at anything beyond basic front-end work (HTML and CSS), so I’ll have to look more carefully at the ideas you are suggesting when I get on the computer and see if those are along the lines of what I’m aiming for. I’ll let you know.

Thanks again!

Offline

#6 2014-10-23 20:57:45

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: Google Calendar support

I’ve got a plugin to do this sort of thing but it uses the current Google calendar public feed … which looks like it’s going to disappear in mid-November. There may still be some form of simple feed still available after this date but it would require a new plugin.

When I say “I’ve got a plugin” – I mean it’s unreleased/bodged up/could be done better etc etc. My excuse is that I’m waiting to find out what Google kills off before I sort it out. It works though and I’m using it to display lists of future events.

From what I understand, all the old calendar API’s are being canned in favour of one that requires OAuth authentication. This complicates things (coding/implementation/aggravation etc) ten fold.

The simple feeds don’t require authentication and I’m hoping that whatever is left is still usable/adaptable.

What ever happens I’m going to have to sort something out – I’ve used it on a client website! In the future there may even be some link up with Bloke’s smd_calendar.

Offline

#7 2014-10-23 21:51:49

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Google Calendar support

I’ve used smd_xml to get calendar data via a Google Calendar. Something like this works when you replace the GOOGLE_CALENDER_FEED_URL with the XML Calendar Address from the calendar settings.

<txp:smd_xml data="GOOGLE_CALENDER_FEED_URL" record="entry" fields="title,summary,content" wraptag="ul" break="li">
<h1>{title}</h1>
<p>{summary}</p>
<p>{content}</p>
</txp:smd_xml>

My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

Board footer

Powered by FluxBB