Archive for December, 2009

How to embed XML and source code in WordPressMU/WPMU using the SyntaxHighlighter plugin

Monday, December 14th, 2009

xml.pngWay back in late 2007 when I launched blogs.voxeo.com, one of my very first problems was in trying to figure out how to include snippets of VoiceXML, CCXML and CallXML code. I wrote about trying a number of different WordPress plugins back in March 2008 and at the time didn’t have much luck. When we have been including source code in blog posts, it has admittedly been using the über-kludgey way of converting all the XML tag syntax into HTML character entities, inserting non-breaking spaces, etc. A serious kludge.

Over the weekend I saw the recent post on the WordPress.com blog about posting source code which pointed me to the excellent “SyntaxHighlighter Evolved” plugin from “Alex / Viper007Bond” (view his plugin page) that is in turned based on the JavaScript SyntaxHighlighter package from Alex Gorbatchev. I installed it in WordPress MU, tested it out on an experimental blog I use for testing and then activated it sitewide.

Now, when I simply bracket VoiceXML code with “[ xml ]” and “[ /xml ]” (without the spaces), it comes out looking great. Here is an example:



<?xml version="1.0" encoding="UTF-8"?>
<vxml version = "2.1" >

  <form>
    <block>
    <prompt>
      Hello World. This is my first telephone application.
    </prompt>
    </block>
  </form>
</vxml>

It is, of course, not limited to merely XML. There are 20+ languages listed on the SyntaxHighlighter ’syntax files’ page. I expect that we’ll be using it now to be able to better write about the Tropo.com languages over on the Tropo blog.

syntaxhighlightermenu.pngOne aspect I quite like about the plugin is the menu you get when you move your mouse over the source code. As shown in the image to right, you can easily:

  • view the source code in a pop-up window
  • copy the code to your clipboard
  • print the code

Given that we’re planning to make more tutorials available, having the ability to copy and paste the code easily directly from the blog post is a great feature.

Many kudos to the two Alex’s for making both the underlying JavaScript library and also the WordPress plugin. And if you run a WordPress or WordPress MU site, you can download the SyntaxHighlighter plugin and install it in your site, too.

P.S. I should in fairness point out that a couple of colleagues have mentioned SyntaxHighlighter to me over the past few months… I just never had a chance to check it out until now.


UPDATE #1, a few minutes after posting: So it seems I still need to work out a kink in my own process. I almost always write my posts offline using the MarsEdit editor and then publish them to the blogs.voxeo.com site. However, when I did that with this post, I wound up with code that had tags escaped as HTML character entities:

syntaxhighlighterfail-1

I had to go back into the WPMU editor on the website and paste in the correct VoiceXML code.

I’m not sure if the issue is with MarsEdit, my WPMU config or the SyntaxHighlighter plugin… but obviously I can’t really write posts with code in them offline until I figure it out…


If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


WordTwit – a great way to tweet posts from WordPress MU

Friday, December 4th, 2009

wordtwitlogo.jpgBack in June, I asked about what people thought the best plugin was for publishing updates to Twitter when there are new blog posts posted here in WordPress MU/WPMU. I was then and have been using Alex King’s excellent Twitter Tools plugin for WordPress, but it was a bit like using a screwdriver to bang in a nail. The Twitter Tools plugin is primarily designed to capture your tweets in a blog post so that you can have occasional posts on your blog site that include all your tweets. The plugin can also publish tweets when you have a new blog post, but it’s real strength seems to be in pulling your tweets into your blog.

All I want to do is publish new tweets… I don’t want to create blog posts with tweets. So I’ve known for quite some time that I’ve been using the wrong plugin for the job… but it’s worked okay, so I continued. I tried a different plugin over on the VoiceObjects Developer Blog, but I haven’t been as happy with it because it tended to shorten the titles of blog posts too much when posting to Twitter.

However, recently my colleague Ron Blaisdell pointed me to WordTwit from BraveNewCode and I have to say that it is outstanding at what I need it to do. Once you install the plugin, there is a very simple configuration screen where you enter your username, password and can change the format of what gets tweeted out:

wordtwit-msg1.jpg

In our case, I chose to edit the message to be “[title] - [link]” so that there is no prefix on any of the tweets.

You then can choose which URL shortener you want to use – I chose bit.ly:

wordtwit-bitly1-1.jpg

After you save the configuration options, you then can go back in and enter your Bit.ly login and API key:

wordtwit-bitly2.jpg

This makes it so that all of your shortened URLs then show up in your bit.ly account where you can see statistics around who has clicked on them, etc.

Because we use Google Analytics, I also checked off an option to add UTM tracking codes to URLs so that I can find any inbound traffic in GA easily.

I’ve been using WordTwit here on blogs.voxeo.com for a bit now and have been very pleased with how well it works. I haven’t yet installed it on the VO Developer Blog but will be doing so soon. Kudos (and thanks!) to the folks at BraveNewCode for developing such a great plugin.

Have you tried WordTwit? Or what plugin do you use for updating Twitter?


If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


WordCamp Orlando is this Saturday, December 5th, 2009

Wednesday, December 2nd, 2009

WordCampOrlando.jpgI was delighted to learn by way of an Orlando Sentinel article that WordCamp Orlando will be happening this Saturday at Rollins College in our home town of Orlando, Florida. If you haven’t figured it out, we’re big fans of WordPress and run this blogs.voxeo.com site on WordPress MU. The WordPress community is a great one to be a part of… and, as demonstrated yesterday, can be of great help!

Anyway, if you have some time, the WordCamp Orlando schedule and speaker list are outstanding and include among others Matt Mullenweg, the founding developer of WordPress!

Definitely worth checking out, in my mind… registration is only $15 and you get a cool T-shirt out of the deal as well!

P.S. And no, I personally won’t be attending because I’m 1,000 miles north in New Hampshire, but some Voxeons in Orlando may head over…


If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.


SOLVED! A truly bizarre WordPress MU / WPMU issue – ONE blog is giving 404s on posts

Tuesday, December 1st, 2009

UPDATE: Outstanding! Within minutes of posting this post, Brajesh (@sbrajesh) and Andrew Rogers (@acedrew) on Twitter both suggested something about permalinks and Brajesh suggested I resave the permalink in Settings->Permalinks.

That did it! I just went into the Permalinks screen in the admin menu, chose a different setting and pressed “Save”. Right then the single-entry views started working again. I then changed it back to the previous “Day and name” setting, saved it again, and it was back to normal.

wmpu-permalinksettings.jpg

Many thanks again to both Brajesh and Andrew Rogers for their quick responses. This is a great part of what makes the WordPress community so great to be a part of!


wordpressmulogo.jpgI am experiencing a truly bizarre issue here on blogs.voxeo.com. If you go to our Voxeo Developers Corner blog at:
http://blogs.voxeo.com/voxeodeveloperscorner/

you see all the posts. Scroll down the page and you can see the various posts. Everything looks great.

But try clicking on any of the titles!

Oops.


404

But here is what I find so bizarre… it is ONLY this one blog that is affected!

All of the other blogs work perfectly fine… this Behind the Blog one, Voxeo Talks, Speaking of Standards… and all the rest. Even our newest Unified Self-Service blog. Viewing single posts works fine on all the other blogs.

As can be seen on the main VDC page, the blog posts are definitely there. When I login to the admin interface, I can see all the posts, I can edit them, I can update them. I can add new posts like the one I put up there today indicating there was this problem. But they just… won’t… display…

I’ve checked the WordPress MU Forums to no avail… I think my next step may be to post this issue over there.

Anyone reading this have any great ideas of what I should check next?

P.S. And yes, I’m running the latest WPMU 2.8.6 – but the issue was also there prior to the upgrade. I hoped the upgrade might fix it, but it didn’t.


If you found this post interesting or helpful, please consider either subscribing via RSS, becoming a fan on Facebook, or following us on Twitter.