Skip to content

Instantly share code, notes, and snippets.

@rchavik
Created July 18, 2014 09:19
Show Gist options
  • Save rchavik/4aacc334943845d97876 to your computer and use it in GitHub Desktop.
Save rchavik/4aacc334943845d97876 to your computer and use it in GitHub Desktop.
idea for element
<?php
if (!isset($latestNews)):
$result = ClassRegistry::init('Nodes.Node')->find('promoted');
$latestNews = $result[0];
endif;
if (!isset($latestPlace)):
$result = ClassRegistry::init('MyPlugin.Place')->find('latestPlace');
$latestPlace = $result[0];
endif;
if (!isset($latestEvent)):
$result = ClassRegistry::init('MyPlugin.Event')->find('latestEvent');
$latestEvent = $result[0];
endif;
?>
<div class="column3">
<?php if (!empty($latestNews)): ?>
<?php echo print_r($latestNews); ?>
<?php endif; ?>
&nbsp;
</div>
<div class="column3">
<?php if (!empty($latestPlace)): ?>
<?php echo print_r($latestPlace); ?>
<?php endif; ?>
&nbsp;
</div>
<div class="column3">
<?php if (!empty($latestEvent)): ?>
<?php echo print_r($latestEvent); ?>
<?php endif; ?>
&nbsp;
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment