Extending Snipsnap (superceded)

This article, which was originally about how to extend snipsnap & was copied across from the snipsnap bliki on 20th June 2013, I gave up on Snipsnap later in the year, and the project has been abandoned by its authors. This content is thus pretty much superseded and the title but not the link has changed to reflect this.. There has been some minimal reformatting undertaken. There are two idioms used which are snipsnap specific; they have been left as originally published and are now a nonsense. Other things will read oddly as I did not pursue my plans. Embedding Disqus broke the backup utility, or more accurately broke the restore.

ooOOOoo

In June 2007, the Snipsnap team stated that development had ceased. The correspondence is at http://www.snipsnap.org, but several users organised the migration of the source code to sourceforge.net. My contrariness mean that it was only after Leo & Funzel moved on to other projects that I decided to investigate certain features. This isn’t yet about developing snipsnap, but really about using it, however, my tag cloud ambitions may require me to write a macro.

Javascript

I’d like to add share buttons as appropriate, but I am having difficulty with the http://addthis.com buttons. See Test Page and Share This pages on this site.

I also like to add disqus widgets to allow non users to comment. This requires both testing the scripts and understanding the snip/blog templates.

CSS

It would be good to have CSS rules that optimised for mobile browsers.

snipsnap-portlets, may also help here. It maybe that several of these could be used. If I decide to hide the sidebar from mobiles I might want to put the search or a bookmark this link into ‘3 which I then show to the mobile.

Also to set up a media=print set of rules to exclude the sidebar and banner from print requests.

The css files are held as snips under a css snip under the theme. I have created a print.css by copying page.css. New Rules need to be created.

On my bliki, I amended the page.css to include a width and margins: auto; rule. This means that the aspect ratio of the page stays fixed independently of the browser window size. The .css files are held as children of ./SnipSnap/themes/${themename}/css and the css snip holds the import statements. 27 Apr 2009

Snipsnap Templates

I have ben considering trying to apply both http://disqus.com and http://addthis.com features to this snipsnap. On Matthias L. Jugel’s advice I have created a new snipsnap portlet called snipsnap-portlet-3. The distribution comes with Nos. 1 & 2. It is published to each page and I need to develop a CSS rule to mange the placement of the object on the page. It is encapsulated within two unique <div> tags,

<div id="page-portlet-3-wrapper">
    <div id="page-portlet-3">

The goal is to implement the above two web tools. Placing a disqus comment on a given page should be simple, it may depend on how disqus references the URI, and also solving the AddThis problem.

With add this a feed URL is simple there is only one that works,

Creating “sharethis” badges seems more difficult as they require the URI and we seem to have some problems with the {html} macro.I can’t see how to make a footer for a blog entry. The -portlet-n technique doesn’t seem to work.

See also Share This and the Test Page.

Mathias (Leo) wrote to me and said,

yes, the portlet-n pages are global, they are for layouting purposes adding more columns or rows etc. However, they can be dynamic. It gets a little tricky here, but try to play with this:

A simple way to use it is, just html fragments as in: http://thinkberg.com/space/travel/Tokyo. Click [create view] and also note that the snip is locked (by the main user/admin) and has the TypeLabel text/gsp

You can add in Groovy code like “You currently look at <%= view %>.” Which is about the same as the macro parameter $viewed.

Well, now for the per blog-entry footer. This is a bit more complicated as it is handled by the weblog macro. What you could do is insert the code using Javascript and the snipsnap-portlet-x, by walking through the blog entries (each has a under snip-content). The alternative is to dig into the code and fix the weblog-macro.

So I looke for and found http://groovy.codehaus.org/Groovy+Quick+Start+Project.

HTML

It would be cool to include HTML, especially scripts in a snip. They have a user contributed macro that does this.The following links, all at http://www.snipsnap.org refer.

These are all a bit old, but Simon Cook found something useful on a .de snipsnap instance that recommended dropping HTMLMacro.jar (from mfranken’s HTMLMacro) into ../webapp/WEB-INF/lib. We couldn’t find the URL again, but we looked for it using “snipsnap 1.0b3 adding macros” as the search string. This is what we did, i.e. dropped the .jar into the CLASSPATH library and restarted the server, the results can be seen on Test Page, and immediately below. N.B. This server is V1.0b3.This needs reinstalling after a database rebuild.

This is rendered HTML

Labels

I though it would be good to have tags and tag clouds, so I need to investigate labels. I have found two resources at http://www.snipsnap.org,

I have used these to create a category label of “Test Page” and assigned that to Test Page 2Obviously this page is labelled Snipsnap, and I have now created a Tags master snip, i.e. not subordinate to my user. I am begining to implement search statements, especially on the tag pages to show their subordinates, and the user Dave page, to avoid having to manually maintain the structured index.

I should research the other tag types and see if the taxonomy tag type will help me represent the IT structures I have created, or if I should just network it. I wonder if I could write a tag search macro? Would this require Java?

Backups

I need to review my backup scripts and threshold management. It’d be good to mail the phone if I run out of space.

Ubuntu JAVA_HOME

What a palaver in discovering the $JAVE_HOME? I chased it down by doing a whereis java, then chasing the links down until there were no more. The reply ends ../bin/java, the rest is the Java Home directory.

Related Posts

8 thoughts on “Extending Snipsnap (superceded)

  1. Dave, 28 Nov 2006

    This was originally a blog article, documenting changes to Snipsnap’s page.css. I said,

    I have now amended page.css in order to implement my Green Robot look and feel in the portlet panel. I have used colo(u)r of #EEE, padding of 10px and borders (1px #999 dashed). Now I need to recreate the .png and then re-export the theme.

  2. Making Comments – I now syndicate this blog page at http://friendfeed.com/davelevy . This permits comments, and so since I usually write a blog article to point at new wiki pages we have the beginings of a commenting system. I am not sure if it notifies me of any comments made, why don’t you try it.

    Snipsnap obviously has its own but no-one has asked for a user id, and its a bit of an overhead to apply for a user here just to comment on these ramblings. I have looked at using OpenLDAP to manage a user community, but it has been too hard to install on the Qube given what I’ve done so far, and what Cobalt did to the build. Other’s have sucessfully used OpenLDAP (and others) to support various levels of administration of a snipsnap community.

    I am looking at how to install http://disqus.com/ within this site, but I am some way from there given how much time I spend on it, so if you want to comment today, you’ll need to use http://friendfeed.com/davelevy .

    See also http://www.openldap.org/

    Originally written in 2008, as a blog article, copied here in August 2013. Obvioulsy my disqus experiment was a dead end because of the backup bug and over the last 6 monts the big boys have been enclosing their communities; friend feed is also no longer any use. 2 Aug 2013

  3. Dave, 13 Nov 2008

    I reorganised this page; I am now experimenting with both optimising the look and feel by media, i.e. print, mobile and ipod and enhancing it with javascript. HTML, Labels and Backup were relegated down the page.

  4. I reorganised this page here; I am now experimenting with both optimising the look and feel by media, i.e. print, mobile and ipod and enhancing it with javascript. I am looking at how to include external services such as share this and disqus, although both Google at Opensocial and Sun at java.net and blogs.sun.com are offering similar customisable features.

    Leo suggests these ideas may point me to Snipsnap’s Groovy implementation. I have started this project by experimenting using my static pages at http://davelevy.info; there’s less I don’t understand to get in the way. I have http://davelevy.info/iindex.html, which is ipodtouch optimised. I am about to re-organise the name space so don’t bookmark it. I have also discovered a bug as it is not using the correct css file.

  5. See Today’s blog post. I also installed Open JDK and Jave 5. The problem is with xalan.jar at Java 6, so we need to use Java 1.5 or find an xalan class library and put it in the class path in run.sh.I have configured run.sh to use Sun’s Java 5.I should consider uninstalling Open JDK.

  6. This content was originally published as a blog article called Sharing my Wisdom on 8th Sep 2009.

    I finally cracked how to get the Add This and Share This buttons into a snipsnap snip. They are both illustrated on Test Page 3. Test Page 3 was not copied to this wiki. This wiki has articles on Add This and Shares This. At the moment, I do not have these web services working on wordpress yet.

    I have added the ‘Add This’ RSS Subscribe button to the sidebar, although since snipsnap has feed auto-discovery it’s a bit redundant. However, the ‘share’ button is easier to use; it inherits the TITLE and URL from the DOM and so I have inserted one here. It’s also closer to my colour scheme. It works with most social networks.

    Actually, I did this work a couple of days ago, but have only just got round to blogging about it. The URL inheritance is quite cute. If you use the button from the [start] page, it will reference the whole [start] page, if you use the blog article URL, or the anchor button, then ‘share this’ uses the internal permalink, in this case “space/start/2009-09-08/2” and will reference you to the blog article itself.

  7. About sharing widgets 14 Sep 2009

    Originally a blog, A couple of days ago, I worked out how to get addthis.com & sharethis.com’s buttons working in snipsnap. I have now implemented a ‘Share This’ button in the sidebar. I chose it because its colour scheme fits mine, and it inherits the title & URL from the snipsnap page DOM, so I don’t have to write any javascript to set the URL and TITLE. This is more appropriate behaviour for an element in a sidebar. I hope this helps you use my site.

    See also http://wiki.davelevy.info/add-this/ and/or http://wiki.davelevy.info/share-this/

Leave a Reply

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