Mediabase - Media & Asset Management
Summary
- Asset management for images and documents of any type
- Multiple ways to organize your assets: categories, keywords, media groups
- Images are renamed upon upload in an non-predictable manner, so no one can crawl your images
- Documents keep their names, but are moved into separate non-predictable named folder for the same reason
- You access images and documents as media objects in your dynamic pages. Multiple display- and render-methods for simple displayment.
- All assets can have versions, so your enduser just has to select motives, not formats.
- Online Image Editor for simple every day image manipulations
- Automatic Image Version Creation
Uploading / Managing Assets
Any user with sufficient rights to access the Mediabase (Editor → Media) can upload images and documents to the Mediabase.
The Mediabase is organized in groups and folders:
The folder structure is generated for you on the fly. So you can give every asset an arbitrary folder path. Unlike with typical file systems, you’ll find that asset later on in any subfolder of it’s path. The path is ment to help distinguish your assets easyly without hiding them in distant folders.
Asset Versions and Online Image Editing
Assets principally can have versions. You can upload new versions when editing an asset. For images you can can create new versions with the built-in Online Image Editor.
Assigning Assets
Next pictures shows a typical content Editing Form with multiple assigned images and an Image Selection PopUp:
When developing such forms for Page Components or Content Objects you use the →form_image() or →form_document()-methods within form initialization of this components. When providing an assignment possibiltity you can limit the selection to a media group and to certain folders. That ensures your editors always select assets out of the right batch.
As written above, assets can have version. It’s not possible to select versions of an asset, when assigning it. That’s purpose. Especially if you have editors, that don’t really have an idea of how HTML/Internet works, these editors doesn’t have to know about versions. They select motives. You have to determine the right version due to smart programming (Remember: Easy Editing !?).
Displaying Assets
To display an asset (or an link to an asset) you need to know it’s ID to construct it:
$myImg = new PhenotypeImage(15); $myDoc = PhenotypeDocument(22);
Displaying an image is really simple:
$myImg = new PhenotypeImage(15); $myImg->display();
This methods echos an XHTML image tag. You can influence the rendering before displayment, by calling following self-explanatory methods:
- →setClass ($class)
- →function setAlign ($align)
- →function setName ($name)
- →function setId ($id)
If your asset has versions, you must select the version first. Following methods are availabe for version handling:
- →hasVersions()
- →selectVersionID($ver_id)
- →selectVersion($name)
- →initVersion($row)
You see, there are many different ways to select an version. There are of course some more methods for displaying and rendering available. All of them return (renderXY) or echo (displayXY) an XHTML tag. See API for more details.
If you have to be more flexibel and the existing methods doesn’t fit your demands, you can access the variables of your mediaobject directly. Following list gives you an overview:
| Variable | Document | Image |
|---|---|---|
| id | x | x |
| grp_id | x | x |
| versioncount | x | x |
| bez | x | x |
| bez_original | x | x |
| keywords | x | x |
| comment | x | x |
| physical_folder1 | x | x |
| physical_folder2 | x | x |
| physical_folder3 | x | x |
| filename | x | x |
| url | x | x |
| suffix | x | x |
| mimetype | x | x |
| file | x | x |
| x | - | x |
| y | - | x |
| alt | - | x |
| thumb | - | x |
| thumburl | - | x |
Importing Assets / PhenotyeMediaBase
There is an object accessible representing the mediabase. Instanciate it like this:
$myMB = new PhenotypeMediaBase();
This object offers methods for importing assets, which is quite an usual use case. All assets are imported in to the standard media group (ID 2). If you want to import assets into another group, you must set the group first:
$myMB->setGroup(5);
After that use the following methods to import images and/or documents. See API doc for more details.
- →importImageFromUrl()
- →importImageVersionFromUrl()
- →importDocumentFromUrl()
- →importDocumentVersionFromUrl()
You think Phenotype Wiki/Documentation could be better?
We too. Please contribute: Edit this page
Recent Blog Posts
- Finally Multibyte - Phenotype 3.0
- Phenotype 2.9 explained
- Integration of PHPIDS (PHP-Intrusion Detection System)
- New Release: Phenotype 2.8 Ready for Download
- Restart: New Phenotype Website Live
- Phenotype worth: 2 Million $
- New Feature: Automatic Image Version Creation
- Additional smartURL variable: smartPATH




