$id = 'bq7F2Zzj4x';
function mountCard( $item ) {
global $dir, $list;
$contentJSON = trim( json_encode( $item->content ), '[]' );
$path = substr( dirname(__FILE__), 0, strpos( dirname(__FILE__), $list->section. '/') );
if ( file_exists( $path . 'uploads/' . $list->id . '/' . $item->media[0]->source ) ) {
$media = '';
} else {
$media = '"media": [
{
"type": "image",
"source": "default.jpg",
"credit": "",
"caption": ""
}
],';
}
$mount = '{
"type": "card",
"item": "' . $item->id . '",
"mode": "open",
"label": "' . $item->label . '",
"title": "' . $item->title . ' properties->custom[0]->content . '\'>' . $item->properties->custom[0]->content . ' flag",
"lead": "' . $item->lead . '",
"tagline": "' . $item->tagline . '",
' . $media . '
"content": [
{
"type": "paragraph",
"content": "' . $item->lead . '"
},
{
"type": "paragraph",
"class": "author",
"content": "Por ' . $item->author . '"
},
' . $contentJSON . '
]
}';
// print_r( $mount ); die();
return render( json_decode( $mount ) );
}
include '../../template.php';