Some of you will have seen my post on Twitter recently about wanting to add extra meta data to the blog editor in Pulse.
I’m in the process of developing a script for a project that relies on a certain amount of information being scraped from Pulse blog posts. Most of the data I need is covered by Pulse already; post title, post date, post content etc but I also need at least one extra line of user supplied data. I thought about tacking this on to the end of the blog content or asking the client to hide it in an HTML comment but after exploring these options they all seemed like pretty basic hacks and didn’t make the workflow look at all nice.
What I’ve done is to extend Pulse to allow for an extra two meta data fields. These are displayed along with the blog post title and date. The data for the fields is stored alongside the original blog post file (1.txt, 2.txt, etc) and is stored in an html file so as not to get listed by Pulse as a blog file itself. What you’ll end up with is a blog directory that contains the original blog file (1.txt for example) and the meta data for that post (1-meta.html).
These alterations to Pulse will work of my project and may be useful to others but it comes with a few limitations that you should be aware of;
- This is experimental work. Use it with caution, or ideally, not at all!
- The core file admin/inc/open.php had to be manually edited. If you update Pulse in the future this file will get written over and you’ll lose this extra functionality.
- It only works with blog posts. If you want it work with pages as well then you’ll need to edit the files.
- The extra meta data fields are hard coded into the extrameta.php file. The file needs to know how to both read and write the data back to the file and this is where that happens.
- The script only supports text data. If you can represent your data as text then it should work for you. Ideally this should be extended so you can define anything here; image uploads, checkboxes, select lists, sliders etc.
- To make use of this new data your theme (or super block) will need to go and find the file and extract the data itself. I’ll leave this as a exercise for the reader.
Here are the files for this. They both live in the admin/inc/ directory. Be sure to have a backup of the original open.php file before you copy these in.
So here’s my feature request;
Can a future version of Pulse please have the ability to read in extra meta data config files like this?