Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Assign metadata to paperclipped assets in Radiant CMS.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
db/migrate
features/support
lib
spec
README.rdoc
Rakefile
cucumber.yml
paperclipped_meta_extension.rb

README.rdoc

Paperclipped Meta

Assign metadata to your paperclipped assets and call them in your radiant pages with <r:assets><r:meta key=“mymeta” /></r:assets>.

INSTALL

Be sure the paperclipped extension is installed.

git submodule add git://github.com/nuex/radiant-paperclipped_meta-extension.git vendor/extensions/paperclipped_meta

rake radiant:extensions:paperclipped_meta:migrate

USAGE

Add what metadata you want to be available in the “More” area (where the caption field is) by setting Radiant::Config. For example:

Radiant::Config['assets.meta.keys']='URL, ID'

Now the URL and ID fields will appear under Caption in the admin UI. From here you can set the metadata for each asset.

In your Radiant pages the following tags are available:

<r:assets title="MyAsset"><r:meta key="key" /></r:assets>
Renders the value for the metadata with this key.

<r:assets title="MyAsset"><r:if_meta key="only_this">...</r:if_meta></r:assets>
Renders the contained block only if there is a value set for the given key.

THANKS

Thanks to Aissac's radiant-custom-fields-extension (github.com/Aissac/radiant-custom-fields-extension) for giving me some direction on the Rspec tests for this extension.

LICENSE

MIT

Something went wrong with that request. Please try again.