A quick introduction to the Canalplan AC Plugin


I thought that it might be a good idea to do a set of posts on the various features of the Canalplan AC Plugin for WordPress and how to use it even though the plugin does contain its own user guide.

The plugin enables three distinct sets of functionality:

  1. Easy linking of Canalplan places, canals etc into your blog posts.
  2. Back Linking from Canalplan Gazetteer entries to corresponding posts in your blog.
  3. “Cruise” blogging from a route imported from CanalPlan.

I plan to cover each of these areas of functionality in separate blog posts along with one covering the various customisation options the plugin supports. In this post I plan to basically cover some of what the plugin can do in general, and if you think bits of this sound familiar its because I’ve “borrowed” bits from previous posts on the subject.

Canalplan Locations – linking and Micro maps

WordPress makes adding links to a post quite easy but to add links to places in Canalplan you’d need to keep getting the urls from Canalplan and posting them into new links. This might be OK for one or two posts but what if you want to actually put a lot of Canalplan places into a blog post.. it would become a complete and utter pain. So the Canalplan Plugin makes this a complete doddle by adding a new input to the Edit Post screen which allows you to find a Canalplan location and insert a link into your post simply by typing a few letters and clicking on a button. You can insert places as either links to Canalplan Gazetteer entries such as :

[[CP:Market Drayton|tnj9]] which presents a link Market Drayton

or you can do it as “micro map”

[[CPGM:Market Drayton|tnj9]] which renders a little Googlemap of the location:


There are a couple of additional options which can be manually inserted to override the defaults which are set on the Plugin page. These options allow you to change some of the map parameters. For example

[[CPGM:Market Drayton|tnj9|height=400,width=300]] produces a larger map that the normal map and I’ve changed the map type to “t” (terrain) :


Of course for those of you who want to show somewhere off the canal system – well you can do that too!

Here is somewhere I used to work :


which was produced using the following code:

[[CPGM:Steve’s Office|nothing|lat=52.077994,long=-2.299249]]

If you hover over the pin in the map you’ll see it contains the text that is shown in the tag, and I suspect you might have already worked out that if you change the text in the first part of the Canalplan tag that it changes the text used in the link/map – so:

[[CP:Market Drayton (Newcastle Road)|tnj9]] would make the following link Market Drayton (Newcastle Road)

So that’s single places dealt with but Canalplan AC also has complete canals in it… so it would be good if the plugin allowed you to basically do what we can do with single locations but with whole canals wouldn’t it? Well it can:

Canalplan Waterways – linking and Maps

Say you’re writing a blog post about the Leeds and Liverpool canal, specifically the Main Line – Wigan to Leeds, and you’d like to link to the Canalplan gazetteer entry for the canal. You could do it by creating a link containing the following url : http://www.canalplan.eu/cgi-bin/waterway.cgi?id=779v

Or you could use the Canalplan linker and again by typing a few letters (to pick the right canal) and a click and your post ends up with [[CPW:Leeds and Liverpool Canal (Main Line – Wigan to Leeds)|71jn]] which creates a nice link for you: Leeds and Liverpool Canal (Main Line – Wigan to Leeds)

But rather than link out to a map wouldn’t it be even better to have a map in your blog post?

[[CPGMW:Leeds and Liverpool Canal (Main Line – Wigan to Leeds) |71jn]] produces a nice map in your post:


Or how about the Shropshire Union Canal (Llangollen Canal – Main Line)


The two examples above show single parts of a Canal which is how CanalPlan stores its canals. But what if you want to show an entire canal? You don’t need to try to patch together bits, we do that for you.

So here’s the complete Leeds and Liverpool Canal :


Or how about the sprawling mess that is the Shropshire Union Canal ?



These last few examples show customisation to the default map with different colours and differing thickness for the line used to draw the canal.

These link and map codes are the basis of most of the functionality of the plugin. In the next post I’ll cover how we actually embed these short codes into a blog post.

21 thoughts on “A quick introduction to the Canalplan AC Plugin”

  1. Great idea, currently implementing on a self-hosted wordpress site. Get Data is taking hours to run. Currently at 60meg, what size is the file and can it be speeded up.

    thanks

    Steve

    1. Its about 225 MB – I’ll talk to nick about creating a cut down version of the data because its grown rather exponentially recently.

      But you’re pulling about 238,450,688 so I think you’re getting it and then its dying.

      you could manually try downloading http://www.canalplan.org.uk/data/stable_canal.sqlite

      and then upload it into the /wp-content/uploads/ folder as canalplan_data.sqlite

  2. Hi,

    It eventually downloaded over night.

    However trying to set home mooring or import any routes is playing up.

    when I click to import routes, it jumps to the canalplan page with the below error

    Error: Syntax error in 1682 of canal.can
    define procedure Queue_Action(a as string, b as string)
    syntax.c:1279::Name Queue_Action already used

    I will try the new version to see if it fixes it.

    Thanks

    Steve

  3. That’s a bug in the route importer – i.e. its a bug in the Canalplan AC website that must have cropped up recently.

    What’s the problem with the home mooring setting?

  4. Well that was impressive – code that worked last week suddenly throwing 500 internal server errors….. Think I’ve found that problem though.. Will now see if the route planning is now unbroken too!… and no it isn’t.

    That will need Nick to check into it as its his code in there.

  5. I seem to have problems with the plugin not ‘autoreading’ ie where you say you start typing and the locations appear (like Google typeahead)

    This happens currently in the home moorings page and also within posts.

    Does it rely on anything being enabled in browser or on server.?

    I can manually insert a tag eg
    [[CPGM:Market Drayton|tnj9]]

    and the blog posts a Google map.

    Thanks

    Steve

  6. yes it does,

    It also does it for the favourites page, so all places ‘typeahead’ is used does not work.

    1. Very odd – is is throwing anything into your php eror logs? Its working here and its not the easiest things to debug due to it using AJAX. What browser are you using?

  7. chrome ie and Safari, tried on 3 machines

    obviously the code connection to the database is fine otherwise the data would not upload.

    The server is on a synology NAS box running what seems like its own tweak of wordpress.

    However, all other plugins have worked so far.

  8. My server settings as per plugin

    Please provide the following information about your installation:
    CanalPlan: (2.6.1 r00)
    File_open Status: file_get_contents is available and can acccess the Canalplan Website – All is OK
    CanalPlan AC (Website): 9.17.24 ( Jul 15 2012 )
    WordPress: 3.3
    PHP: 5.3.10
    PHP Memory Limit: 256M
    PHP Memory Usage (MB): 3
    MySQL: 5.1.49
    Server : Apache/2.2.22 (Unix) PHP/5.3.10

  9. Typeahead works fine.

    Is it in ‘network’ mode as I cannot see a couple of options i have

    WordPress Address (URL)
    Site Address (URL)

  10. Typeahead works fine.

    Is it in ‘network’ mode as I cannot see a couple of options i have

    WordPress Address (URL)
    Site Address (URL)

    1. Yes its in Network mode but for testing you don’t need to worry about that – I just wanted to see if things were working here…
      There were issues with some of the AJAX code and I guess when I’d recoded it last time I’d not managed to flush the cache properly which hid some issues.

      I’ve fixed those and made a change to the diagnostics page so it lists the tables and how many rows they contain.

      http://blogs.canalplan.org.uk/wp-content/uploads/canalplan-acdebug2107-03.zip

      I might need to ask you to set me up with an account on your blog so I can check a few things.

  11. no luck.

    i’ve created an account

    Its on a live system account is

    canalplan

    can i sent password and url to an email address please – old habits die hard.

    Steve

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.