This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html,body { | |
margin:0; | |
padding:0; | |
border:0; | |
outline:0; | |
font-size:100%; | |
font:inherit; | |
vertical-align:baseline; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$item = imanager()->getItemMapper()->init(8, 50); | |
// Accessing a field value | |
echo $item->fields->fieldname->value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$item = imanager()->getItemMapper()->init(8, 50); | |
// Accessing an item attribute | |
echo $item->name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach($item->fields->fieldname->fullurl as $key => $url) { | |
// Output an image with title and url | |
echo '<img alt="'.$item->fields->fieldname->title[$key].'" src="'.$url.'">'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Class ItemSimplificator, just a simple decorator class | |
*/ | |
class ItemSimplificator | |
{ | |
protected $_item; | |
public function __construct(Item $item) { | |
$this->_item = $item; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get an item with the id 50 of the category 8 | |
$item = imanager()->getItemMapper()->init(8, 50); | |
// simplify item | |
$item = new ItemSimplificator($item); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo $item->fieldname; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Output file name 1 | |
echo $item->fieldname->file_name[0]; | |
// Output file name 2 | |
echo $item->fieldname->file_name[1] | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bootstrapping PHPThumb library | |
require_once(GSPLUGINPATH.'imanager/phpthumb/ThumbLib.inc.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns resized image | |
* With the first call creates thumbnail and cached it | |
* | |
* @param object $image - A Field object of an item | |
* @param integer $id - An index of the field value | |
* @param integer $width - Thumb width | |
* @param integer $height - Thumb height | |
* |