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; | |
} | |
?> |
FLEXIcontent: 4 columns for Zurb Foundation 6 after $leadnum:
<?php if ($i % 4 == 0) : ?>
<div class="pad20" data-equalizer="tbox" data-equalize-on="medium">
<div class="row fixedw" data-equalizer="cbox" data-equalize-on="medium">
<?php endif; ?>
<div class="small-12 medium-3 columns <?php if ($i == $count - 1) : ?>end <?php endif; ?>mb-20">
<h2><?php echo $i;?></h2>
</div>
<?php if ($i % 4 == 3) : ?>
</div></div>
<?php endif; ?>
<?php endfor; ?><?php if ($i % 4 != 3) : ?>
</div>
</div>
<?php endif; ?>
Check if field exists or not - change 'top_banner' to field name
<?php if (isset($this->item->fields['top_banner']->display)&&!empty($this->item->fields['top_banner']->display)):?>
<h1>CODE</h1>
<?php endif;?>
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; ?>
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
CALL RAW FIELD: in ITEM -> field name is type