Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

home page slider pics is now dynamically loaded

  • Loading branch information...
commit 5f368fc2f51ea31a83f2f9fcf7eb22c5f2eee15e 1 parent 914b9f4
@s3265176 authored
View
6 app/Plugin/Nodes/Controller/NodesController.php
@@ -822,6 +822,12 @@ protected function _setCommonVariables($type) {
public function home(){
$this->layout = 'foundation';
+
+ $dir=APP."plugin/Croogo/webroot/img/home_slider";
+
+ $imgs = array_slice(scandir($dir,1),0,-2);
+
+ $this->set('images',$imgs );
}
public function news(){
View
28 app/Plugin/Nodes/View/Nodes/home.ctp
@@ -19,22 +19,18 @@
<div class="large-12 columns">
<div id="slider">
<ul data-orbit>
- <li>
- <?php echo $this->Html->image('home_slider/1.jpg');?>
- <div class="orbit-caption">...</div>
- </li>
- <li>
- <?php echo $this->Html->image('home_slider/2.jpg');?>
- <div class="orbit-caption">...</div>
- </li>
- <li>
- <?php echo $this->Html->image('home_slider/3.jpg');?>
- <div class="orbit-caption">...</div>
- </li>
- <li>
- <?php echo $this->Html->image('home_slider/4.jpg');?>
- <div class="orbit-caption">...</div>
- </li>
+
+ <?php
+ foreach ($images as $image ) {
+ $parts = explode(".", $image);
+ $description = $parts[0];
+ echo '<li>';
+ echo $this->Html->image('Croogo.home_slider/'.$image);
+ echo "<div class='orbit-caption'>".$description."</div>";
+ echo '</li>';
+ }
+ ?>
+
</ul>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.