them / frog_page_metadata
- Source
- Commits
- Network (0)
- Issues (0)
- Downloads (8)
- Wiki (1)
- Graphs
-
Tag:
0.0.1
| name | age | message | |
|---|---|---|---|
| |
PageMetadataController.php | ||
| |
README.markdown | ||
| |
disable.php | ||
| |
enable.php | ||
| |
frog-plugins.xml | ||
| |
index.php | ||
| |
models/ | ||
| |
page_metadata.css | ||
| |
page_metadata.js | Sun May 10 07:09:08 -0700 2009 | |
| |
views/ |
About
This is a simple plugin for the Frog CMS. It adds the ability to add more metadata to a page object.
Motivation
I'm currently writing on a plugin that needs extra, custom metadata for a page. I didn't want to create a specific database table, so I contribute this generic plugin that can be used to store generic metadata for a page.
Requirements
Install
Protect your plugins. Edit config.php and add the following line:
define('IN_FROG', true);
Copy plugin files to frog/plugins/page_metadata/ folder.
cd frog/plugins/
git clone git://github.com/them/frog_page_metadata.git page_metadata
Usage
The 'visible' part of the plugin adds another tab to the page view: the 'More Metadata' tab. With this dialog any metadata (keyword value pairs) can be added to an existing page. If the value left blank, the metadata gets removed
Getter
The 'PageMetadata' exports the following static functions:
FindAllByPageprovide the page or page_id as parameter.FindAllByPageAsArraysame as above, but returns a simple PHP arrayFindOneByPageAndKeywordreturns the value or false for this page and keyword (NOTE: no caching is applied to this function. Ideally use it only once)
NOTE: inside a view the page object is the '$this' reference.
Extensibility
Because the plugin was generated as a helper plugin for other plugins, the plugin can be extended as well.
Observers
The Frog CMS offers an observer mechanism to extend the core. The 'PageMetadata' plugin exports the following subscribable 'topic':
view_page_page_metadata with the page as parameter.
Visibility
If the metadata has the 'visibility' of '0', the user is not able to alter the metadata directly. This value should be manipulated (e.g. select box) by another plugin that is using the 'observer topic'.

