new pages

Permalink
Hello

It's a long time since I use C5 and doing a site for a client, can someone tell me how to make a page template, or block so when they select to add a sub page it displays automatically with the following 3 blocks
an image placement,
WYSIWYG text section
and some way to add an external link.

So when they add it, it displays like the attached file? with the book now button been the external link

Thanks in advance

Mal

1 Attachment

 
andrewjaff replied on at Permalink Reply
andrewjaff
Hi, create a page type from dashboard. rename your html to your page type handle name.

for create area in teplate
you can by this
$a = new area('area name');
$a->display($c);
osgmal replied on at Permalink Reply
Hi Andrew,

unsure what you mean could you elaborate a bit more?

Cheers

Mal
exchangecore replied on at Permalink Reply
exchangecore
Concrete5 has already posted a pretty extensive guide on how to go about creating a theme. Check out parts 1-4 of basic theme development.

http://www.concrete5.org/documentation/recorded-trainings/theme-dev...
osgmal replied on at Permalink Reply
Hello

I've created my theme as I require with a page called break_page I've assigned the following Page/Theme Attributes:

is_featured
page_list_thumbnail
main_image
external_site_url

When cretating a new page using the break_page.php I have managed to find an add onhttp://www.concrete5.org/marketplace/addons/page-properties/... to add page title & page description to the page when I fill in all the page properties.

I have managed to get external_url displaying by the following:
<?php echo $c->getAttribute('external_site_url'); ?>

But doing the same for Images I get errors, after a quick look online, I found the following code:

$file = $page->getAttribute("main_image");
if (is_object($file)) {
    $im = Loader::helper('image');
    $im->output($file);


but I now get an error:

Fatal error: Call to a member function getAttribute() on a non-object in D:\_sites\c5test\themes\mytheme\break_page on line 44

unsure why???

Could someone let me know how to pull the image on to the page when creating the page, in the same way I can add page title, description & external_site_url

I've placed below the break_page theme template code as it won't let me attached the page?? to see if I'm doing this right.
<!DOCTYPE html>
<html>
<head>
<?php
  $u = new User();
  if($u->isRegistered()) {
      Loader::element('header_required');
  }
  else {
   $page = Page::getCurrentPage();
   echo '<title>'.$page->getCollectionName().'</title>';
  }
?>
<link href="<?php echo $this->getThemePath(); ?>/css/bootstrap.min.css" rel="stylesheet">
<link href="<?php echo $this->getThemePath(); ?>/css/font-awesome.css" rel="stylesheet">


Any help appreciated.

Cheers

Mal