Sidebar List Pod Template


/ Published in: PHP
Save to your folder(s)

The template used for each sidebar record displayed. Contains a bunch of conditional to do different things based upon options set for each sidebar.


Copy this code and paste it in your HTML
  1. <?php
  2. $callouts = $this->get_field('callouts');
  3. $alignment = $this->get_field('title_align.name');
  4. if($alignment == 'Left') {
  5. $alignment = 'left';
  6. } elseif($alignment == 'Center') {
  7. $alignment = 'center';
  8. } elseif($alignment == 'Right') {
  9. $alignment = 'right';
  10. } else {
  11.  
  12. }
  13. $callout_image = $this->get_field('callouts.image.guid');
  14. if($this->get_field('display_highlight') == true) {
  15. $color = strtolower($this->get_field('highlight_color.name')) . ' highlight';
  16. } ?>
  17. <li id="{@slug}" class="widgetcontainer widget_{@slug} <?php echo $color; ?> <?php if($callouts !='') { ?>callout<?php } ?>">
  18. <?php if($callouts !='') { ?>
  19. <?php foreach($callouts as $key => $callouts_array) { ?>
  20. <a href="<?php echo $callouts_array['link']; ?>"><img src="<?php echo $callout_image; ?>" alt="<?php echo $callouts_array['name']; ?>" /></a>
  21. <a href="<?php echo $callouts_array['link']; ?>"><?php echo $callouts_array['name']; ?></a>
  22. <?php } ?>
  23. <?php } else { ?>
  24. <?php if($this->get_field('display_title') == true) { ?>
  25. <?php if($this->get_field('title_link') != '') { ?>
  26. <div class="sidebar-top"></div>
  27. <div>
  28. <h3 class="widgettitle <?php echo $alignment; ?>"><a href="{@title_link}">{@name}</a></h3>
  29. {@content}
  30. </div>
  31. <div class="sidebar-bot"></div>
  32. <?php } else { ?>
  33. <div class="sidebar-top"></div>
  34. <div>
  35. <h3 class="widgettitle <?php echo $alignment; ?>">{@name}</h3>
  36. {@content}
  37. </div>
  38. <div class="sidebar-bot"></div>
  39. <?php } ?>
  40. <?php } else { ?>
  41. <div class="sidebar-top"></div>
  42. <div>{@content}</div>
  43. <div class="sidebar-bot"></div>
  44. <?php } ?>
  45. <?php } ?>
  46. </li>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.