Like page attributes, I’m trying to hardcode some Express object attribute values directly in a theme page template.
Is there an easy way to do this?
I was going in this direction as this works in custom Express entry detail templates.
<?php
if (isset($entry) && is_object($entry)) {
$plaats = $entry->getPlaats();
?>
<?php echo $plaats ?>
<?php } ?>
But what would make this work in a theme page template?
Parasek
2
Something like that:
<?php
$expressEntry = $c->getAttribute('attribute_handle');
?>
<?php if (is_object($expressEntry)): ?>
<?php
$selectedEntries = $expressEntry->getSelectedEntries();
?>
<?php if (isset($selectedEntries[0])): ?>
<?php
$entry = $selectedEntries[0];
?>
<div><?php echo h($entry->getAttribute('name')); ?></div>
<?php endif; ?>
<?php endif; ?>
Yes exactly that!
(banging his head against the floor after 1001 attempt and this duude just shakes it out of his shirt! )
Thanks!