Publishing to CMS

I’m back to pondering the best way to get club members publishing content to a Content Management System, in my case Joomla.

Sailwave offers me two options neither of which are perfect:

  1. I can FTP content to my site and then somehow warp that in the Content Management System

  2. I can upload the post using the “Blog” option.

Option 1 is in theory good because I can set an FTP account up that only has access to mydomain.com/results and post up the content from the club computer saving the u-name and p-word in the config of sailwave. Of course I might want some structure in the files uploaded but I can always tidy them later. But its clunky, and putting html within a template for another html page is far from perfect, not to mention searching and functions like highlighting new content within the CMS will just not happen.

Option 2 sounds better. I can basically let the user copy and paste the results table into the CMS new content page. But that doesn’t delete any older content so last weeks result is still there and the week before etc. So still needs tidied up manually. But the big reason I’m not keen is security. I would need to either give all my race officers web editing access (eek!) or have a results web editing account (perhaps only to the results pages) with the password stuck on the club computer (eek again!)

So the ultimate solution is to upload it using a plugin. Logic would be to simply dump a XML or JSON file and let some PHP deal with it. There may be some fields I’d prefer not to do that with such as “medical” although my club never uses them. I could possibly think of ways to strip them before they are saved. The joomla side would need some form of crypto code to authenticate the uploading sailwave, saved on the PC so my end user just hits “publish to Joomla” and it goes. Joomla can sort the structure from dates, names etc and present a menu for the web user…

Apart from wordpress being different etc why not? All it’d need from the sailwave side would be the ability to save a file locally on the PC, then open a web page (set in a config page) and attach the file and hit submit… …I’d write the rest in joomla?

And I’d program in the sailwave link which a pasting user can delete :wink:

There has been discussion on and off over the years on doing this. To make a tight integration would probably require changes in Sailwave (specifically, some options for identifying the particular score sheet so that Joomla could do something with it), and the building of a component for Joomla itself.

For events that have a specific Joomla website, I put together a little bit of PHP code that allows a score to be imbedded into a Joomla article, then I just use the article as the score presentation on the website. The advantage of that is that it maintains the look and feel of the site, while at the same time allowing the scorer to upload changes in the file without needing to touch Joomla itself.

Here’s an example from an event we just finished a few days ago:

http://www.banderasbayregatta.com/results/2015-03-04-03-05-49

The code to do this is here in the messages somewhere. Just search for “php” and you ought to find it. The requirement is that you have a system plugin for Joomla that allows for php code to be run, and that you have an article editor that allows you to edit source without changing it, like CodeMirror.

If you have any questions, you can email me at andy@sailor.nu.

There has been discussion on and off over the years on doing this. To make a tight integration would probably require changes in Sailwave (specifically, some options for identifying the particular score sheet so that Joomla could do something with it), and the building of a component for Joomla itself.

I think there is a unique ID in the XML file but I could be wrong. Joomla would just check if that was new and create a new event or existing and update existing.

But yes there would be some work needed in the J! Component side. That’s not beyond me. Getting proprietary code of sailwave to spit out something usable is :wink:

For events that have a specific Joomla website, I put together a little bit of PHP code that allows a score to be imbedded into a Joomla article, then I just use the article as the score presentation on the website. The advantage of that is that it maintains the look and feel of the site, while at the same time allowing the scorer to upload changes in the file without needing to touch Joomla itself.

Cheers I think that’s the post I stumbled on just after posting. I think to avoid inserting PHP it makes sense to take that code and create a plugin that might take an entry like {sailwave:21012015.htm} and embed it. That’s within my capability. Should then be possible to have a text editor button that let’s you pick a file. Also would work from my events calendar too… Just get my guys to always name the file with the first day of a series with -open or -club depending which it is to allow for multiple events in a day…

Are you happy for me to reuse your code? I haven’t read it through but have you attributed it a GPL licence?

We update twitter and faceache automatically when news is posted… Should be possible to have a plugin check the results folder every hour or so, then if there is new content to generate a tweet etc. Just pondering how best to link that… To the sailwave HTML alone or to joomla content…

···

On 2015-03-10 13:36, andy@sailor.nu [sailwave] wrote:

Here’s an example from an event we just finished a few days ago:

http://www.banderasbayregatta.com/results/2015-03-04-03-05-49

The code to do this is here in the messages somewhere. Just search for “php” and you ought to find it. The requirement is that you have a system plugin for Joomla that allows for php code to be run, and that you have an article editor that allows you to edit source without changing it, like CodeMirror.

If you have any questions, you can email me at andy@sailor.nu.

I've been having a little play today and yesterday. I've created two
Joomla plugins. One using the code Andy posted here previously and one
to create a tag to make it easier to access that.

They are hosted on git.hub:

https://github.com/polc1410/Sailwave4Joomla

With the installation package available here:

https://github.com/polc1410/Sailwave4Joomla/blob/master/Sailwave4Joomla.zip

Once installed you need to publish the two plugins (probably makes
sense to anyone in Joomla world) and set some parameters in the Content
plugin which is basically:

Where your sailwave files go. So if your site is www.example.com and
sailwave files are at www.example.com/results you enter /results in the
text box and the second part is a CSS Style box which you can use to
tweak the style aplication.

With the two plugins installed you can simply enter:

{sailwave: filename-without-extension} in the editor and it will insert the content. If the file does not exist a box says "Sorry no results available"

If you click on the Sailwave Button that is added under the editing window a pop-up box appears allowing you to browse for the file or if the file has not yet been uploaded to enter a name which you will give the the scorer.

There is more to come. I will post progress on these in days to come...

The plugin uses language files so if someone wanted to translate it, it is fairly easy.

Many thanks to Andy for his chunk of code that has made the process much simpler.

I'm releasing this under GPL2 (unless Andy advises his code should be differently licenced) - so its there for the community to do as they want with it.

Calum

···

--
Calum Polwart <yahoo@wittongilbert.free-online.co.uk>