Wednesday, June 16, 2010

Bookmark TagLib

Today I have created a taglib for creating bookmarks. It needs two attributes attrs.type and attrs.id, where type corresponds to the class name. There is only JS code for Internet Explorer and Firefox included, so unfortunately it won't work on other browsers (yet).

def includeBookmarkThisPageLink = {attrs ->
  def url = request.getRequestURL().toString().replaceFirst(".dispatch", "").replaceFirst("/grails", "") + '/' + attrs.id
  def title = attrs.type.get(attrs.id)
  
  out << """"""
 }

No comments:

Post a Comment