Media files in Manifesto are, for the most part, raw data structures that you will not usually interact with.
In most cases, you will be using a MediaInstance object, which is an instance of a particular Media object in a particular context, e.g. associated with another piece of content like a page or a blog post. A MediaInstance object may have a different caption, or different output dimensions or alignment than the base Media object it represents.
Fully-instantiated Manifesto objects that support images all have an
media_array property (each element is a full MediaInstance object, and the array is iterable). You may also retrieve the associated image marked as the “icon” of your content with the simple call:
$img = $obj->get_icon();
and then display it with one of the pre-built output methods.
Output standard size image in an IMG element, optionally linking to URL from $img->linkto property:
Output the thumbnail image in an IMG tag, optionally linking to $url:
Full-blown FIGURE tag with any size variant and FIGCAPTION if $img->caption is not empty:
Bear in mind that all of these media insertion methods will also work with PDFs, documents, video files, etc. Each of them will handle the proper output method determined by the Mimetypes array and the methods in the
If you prefer to handle the HTML output yourself:
will get you the full URL to your media file.
Manifesto uses its own internal Date object for convenience, and automatically converts database date and datetime formats to Manifesto
Date objects when they are retrieved from the database. From that point, you simply need to figure out what format you want to be used in the output:
$d = Date::now(); echo $d->get_date($format=null);
January 30, 2012or
30 January 2012
Sunday, 30 January 2012
Jan 30, 2012 14:45or
30 Jan, 2012 14:45
30 Jan 2012 2:45:13 PM
30 Jan 2012 14:45:13 UTC
1/30 14:45 ESTor
30/1 14:45 EST
13 (Week of year)
30 Jan 2012)