Jump to content

PNMorrison

New Members
  • Posts

    7
  • Joined

  • Last visited

PNMorrison's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Fantastic! Understood. Thanks again pal. U have been a massive help!!
  2. Super! This works great. It works using both formats for the date object. If i use the 'Y m d' format as advised however, how do i then i display the date on the banner in 'F dS Y' format still? Thanks for all ur help guys - i really appreciate it. I will be starting a course soon, so hopefully one day i can pay it forward..
  3. Hi mate that was pretty much the full contents of the file (view.php) <?php defined('C5_EXECUTE') or die("Access Denied."); //echo $description; //echo $backgroundImage->src; //echo $background_color ?> <div class="content_wrap white events"> <h5>Events</h5> <p class="alpha"><strong><?php echo Loader::helper('truncate')->softTrim($title, 50); ?></strong></p> <div class="event_details"> <time><?php echo $date;?></time> <address><?php echo $venue;?></address> </div> <a href="<?php echo $path;?>" class="beta absolute">Book your free place </a> </div> It is called from the page-type below (i have commented out the call in bold as to prevent displaying on the site) - scroll to bottom.. <?php defined('C5_EXECUTE') or die("Access Denied."); //Page Name $c->getCollectionName(); //Event Venue Date Attribute if($c->getAttribute('event_date')) { $event_date = strftime(" %d %B %Y",strtotime($c->getAttribute('event_date'))); }else{ $event_date = 'Please supply the event date in custom attributes'; } //Download Attribute $download = $c->getAttribute('download'); $path = File::getRelativePathFromID($download->pdfFile); ?> <div id="page_wrap" class="container sub_page event_p"> <div class="breadcrumb"> <div class="breadcrumb_container"> <nav> <ul> <?php $blk = Block::getByName('Breadcrumb'); $blk->display(); ?> </ul> </nav> </div> </div> <div class="wrap"> <header class="row"> <div class="col span_6 info_header"> <h1><?php echo $c->getCollectionName() ?></h1> <time><?php echo $event_date;?></time> <?php if($c->getAttribute('event_venue')) { echo '<address>'; echo $c->getAttribute('event_venue'); echo '</address>'; }?> </div> </header> <div class="row"> <div class="main main_left col span_8"> <div class="content_wrap"> <a href="<?php echo View::url('/news-events/events/') ?>" class="cta_back beta col">Back to all events</a> <section class="col"> <?php if($c->getCollectionDescription()){?><p class="intro"><?php echo $c->getCollectionDescription() ?></p><?php }?> <?php $a = new Area('Main'); $a->display($c); ?> <?php if($download->label) { ?><a href="<?php echo $path;?>" class="cta download" download="Download File" target="_blank"><?php echo $download->label; ?></a><?php }?> </section> <hr /> <?php if($event_venue){?> <h3 class="gamma">Location</h3> <address><?php echo $event_venue;?></address> <?php }?> <?php if($c->getAttribute('archive')); elseif($c->getAttribute('full_booked')) { echo '<p style="padding: 10px 20px; color:#fff; background:#005f94; float:left; margin-top:20px;">This event is fully booked</p>'; }elseif($c->getAttribute('by_invite')) { echo '<p style="padding: 10px 20px; color:#fff; background:#005f94; float:left; margin-top:20px;">This event is by invitation only</p>'; }else{ $block = Block::getByName('Event Form'); if(is_object($block)) $block->display(); }?> <a href="<?php echo View::url('/news-events/events/') ?>" class="cta_back beta">Back to all events</a> </div> </section> </div> <?php $a = new GlobalArea('Events Sidebar'); $a->setBlockWrapperStart('<div class="col span_4 sidebar">'); $a->setBlockWrapperEnd('</div>'); $a->display(); ?> <div class="col span_4 sidebar grid"> <?php /*$block = Block::getByName('Event'); $block->display();*/ ?> </div> </div> <?php $this->inc('elements/partner.php'); ?> </div> thank for looking at this - i really do appreciate it. And i'm learning a great deal.
  4. Concrete5 I'm using pal
  5. The website is a CMS written in php. The filesystem seems very convoluted.. Below is the bit of php code in the page template.. But I suspect this is not wot u mean either.. $block = Block::getByName('Event'); $block->display();
  6. Thanks Muddy_Funster Could this be the control script u refer to:- public function getMetaData($pageId){ $page = Page::getByID($pageId); if($page) { $data = array( 'Title' => $page->getCollectionName(), 'Description' => $page->getCollectionDescription(), 'Background_Image' => $this->getImage(), 'Path' => BASE_URL . View::url($page->getCollectionPath()), 'Venue' => $page->getAttribute('event_venue'), 'Date' => $page->getAttribute('event_date') ); return $data; } } Thanks again
  7. I have the following code in my view file for an event block:- =============================================== <div class="content_wrap white events"> <h5>Events</h5> <p class="alpha"><strong><?php echo Loader::helper('truncate')->softTrim($title, 50); ?></strong></p> <div class="event_details"> <time><?php echo $date;?></time> <address><?php echo $venue;?></address> </div> <a href="<?php echo $path;?>" class="beta absolute">Book your free place </a> </div> ================================================= Application logic causes this to display a banner on my site with date of 'January 1st 1970' when there are no events set up on the web (when all events have expired.) ​I need this to display something else (or nothing at all) when there are no events published. ie IF database query returns 0 (or null) { DO SOMETHING DIFFERENT} ELSE DO THE BELOW <div class="content_wrap white events"> <h5>Events</h5> <p class="alpha"><strong><?php echo Loader::helper('truncate')->softTrim($title, 50); ?></strong></p> <div class="event_details"> <time><?php echo $date;?></time> <address><?php echo $venue;?></address> </div> <a href="<?php echo $path;?>" class="beta absolute">Book your free place </a> </div> Any help is greatly appreciated. Or even knowing what exactly i need to Google (being a complete novice)...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.