Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-12-08 23:46:39

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Microdata, JSON, HTML

I’ve been marking up articles with microdata as defined at schema.org

Handy thing here lets me process microdata-infused HTML into several handy things: JSON, vCard, iCal

My thinking is that:

  1. It is possible to build up some TXP templates that can feed a JSON copy of my site’s selected content (Articles, Bios, etc…)
  2. It is possible with jQuery.getJSON() to let a remote domain pull my content in, convert it to HTML and style it with their own CSS referencing the IDs and Classes I have provided standard.

Is this crazy talk? I can’t sleep.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#2 2011-12-09 00:52:12

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

Re: Microdata, JSON, HTML

I’ve played with using rah_external_output to create json output of article data for use on a google map. It’s doable but I think I abandonded my project for some other reason.


My Plugins

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

Offline

#3 2011-12-09 01:30:28

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: Microdata, JSON, HTML

MattD wrote:

I’ve played with using rah_external_output to create json output of article data for use on a google map. It’s doable but I think I abandonded my project for some other reason.

Ah yes. That plugin thread I had read some time ago and believe that remnants of it’s info were still dancing in my head. Thanks for the point to.

Do you still have any code chunks laying around? Really curious to see if you do as I’ve never worked with structuring JSON and only have a vague idea that if I do it will be the thing that will allow me to “feed” stuff out in an API fashion to developers at other domains.

I have nightmares about providing a txp:tag style JSON parser, if that’s the right way to put it, on the other end too. Let’s say my prefix is ov – I’d dream of <ov:article field="something" /> which would allow devs to pull in stuff and lay it out where they want to and as mentioned before to style it according to the IDs and Classes I’ve sent over standard. Not sure JSON can deliver the IDs and Classes so perhaps the JSON to HTML conversion will have to build those in somehow.

Last edited by whaleen (2011-12-09 01:30:47)


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#4 2011-12-09 02:50:49

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: Microdata, JSON, HTML

rah_external_output has proved capable of outputting all my stuff: hCard, iCal, vCard, JSON, etc… with ease. I thank you again Matt for pointing it out.

Now to explore doing things with that output on other servers. :)

If anyone has any suggestions on where to start looking for ways to display the aforementioned content-types on remote pages as HTML I would be much obliged and will post back as well if I come across anything good if it’s of any interest to anyone reading this.

Last edited by whaleen (2011-12-09 02:55:49)


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#5 2011-12-09 03:03:23

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: Microdata, JSON, HTML


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#6 2011-12-09 04:58:29

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 595
Website

Re: Microdata, JSON, HTML

If anyone has any suggestions on where to start looking for ways to display the aforementioned content-types on remote pages as HTML

That Pure thing is pretty cool.

I used smd_xml to parse and present data from the Piwik API, and it worked great. I had a smd_tabber tab displaying that data in a very customized way. :-) You can create an API for your sites using rah_external_output, and share data easily between them.

Edit: Oh wait, this thread is about JSON, sorry :-/

Last edited by maruchan (2011-12-09 05:06:00)

Offline

#7 2011-12-09 07:54:02

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: Microdata, JSON, HTML

I used smd_xml to parse and present data from the Piwik API, and it worked great. I had a smd_tabber tab displaying that data in a very customized way. :-)

Even if off-topic, I’d love to see what you came up with there. I’ve long wanted to bring certain stats into the back end but never had enough time to investigate it fully.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB