Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languageruby
linenumberstrue
Permalink.on_generate do |obj|
  # Create a permanent link resource that will resolve/redirect to obj
  # and that resource as a URL string. e.g., 
  return "http://permalinkresolver.example.edu/media/#{obj.pid}"
end

To create permalinks for Media Objects only, and not direct links to sections:

Code Block
languageruby
linenumberstrue
Permalink.on_generate do |obj|
  if obj.is_a? MediaObject
    return "http://permalinkresolver.example.edu/media/#{obj.pid}"
  else
    return nil
  end
end