Created
June 13, 2016 17:39
-
-
Save iamrobert/c45e691befad382a3eb6023312716b14 to your computer and use it in GitHub Desktop.
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
CALL RAW FIELD in ITEM -> field name is type | |
<?php $fieldname = 'type'; | |
if ( !isset($item->fields[$fieldname]->parameters) ) { | |
FlexicontentFields::loadFieldConfig($item->fields[$fieldname], $item); | |
} | |
$extra_props = array(); // use $extra_props = array('image'); // if radioimage or checkboximage field | |
$elements = FlexicontentFields::indexedField_getElements( $item->fields[$fieldname], $item, $extra_props ); | |
if (!empty($elements)) foreach ($elements as $el) { | |
if ( @unserialize($el)!== false || $el=== 'b:0;' ) $el = unserialize($el); | |
//var_dump($el); | |
// CALL STD OBJECTS | |
echo $el->value; | |
echo $el->text; | |
} | |
?> |
EXTRACT IMAGE URL from SRC Attribute in FLEXICONTENT Universal Module
$doc = new DOMDocument();
$doc->loadHTML(FlexicontentFields::getFieldDisplay( $item, 'blog_cat_image' ));
$imageTags = $doc->getElementsByTagName('img');
foreach($imageTags as $tag) {
echo $tag->getAttribute('src');
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Insert FIELD in FLEXICONTENT UNIVERSAL Module
<?php if (isset($item->_row->fieldvalues[119][0])) :?> <?php //TITLE (CHN) if($item->_row->fieldvalues[119][0] != null): ?> <br><span class="chn"><?php echo $item->_row->fieldvalues[119][0]; ?></span> <?php endif; ?> <?php endif; ?>