Utvikler cookbook

5.1.6. Sidemaler - for siter med flere ulike sidemaler

Forsidemal

 

Standard sidemal

 

Begge disse sidemalene benytter seg av samme generiske kode. Malene brukes slik at de hver for seg henter ut og sorterer det som skal skrives ut hvorpå de så kaller på felles generiske sidemal som printer utseendet. Både Forsidemal og Sidemal henter altså innholdet, stokker det om og benytter visningsmalen som ligger i Generisk sidemal. Det gjør at man kan legge logikk i de to første malene og holde den generiske sidemalen renest mulig. Mens forsidemalen i dette eksempelet ikke gjør noe annet enn å samle ligger det logikk for hvordan den vanlige sidemalen skal plassere ekstramenyer og lignende. Det vil komme en tutorial for hvordan man setter opp dette med sidetyper senere. 

Forsidemal

{*
@title          Frontpage
@description    Frontpage template
@type           page
@compatibility  EP_Page 
@bundle         eross
*}
{* Global placeholders *}

{capture assign=header}
	{$ep_global_eross_meta}
{/capture}

{capture assign=head_left}
  {$ep_global_eross_head_left}
{/capture}

{capture assign=menu_main}
  {$ep_global_eross_nav}
{/capture}

{* Local placeholders *}

{capture assign="content"}
	{$ep_documentcontent} 
{/capture}

{* Include page *}
{include file="eross-page-generic.tpl"}

 

Sidemal

{*
@title          Page, generic
@description    Default page template
@type           page
@compatibility  EP_Page 
@bundle         eross
 
*}
{* Global placeholders *}

{capture assign=header}
 {$ep_global_eross_meta}
{/capture}

{capture assign=head_left}
 {$ep_global_eross_head_left}
{/capture}

{capture assign=menu_main}
 {$ep_global_eross_nav}
{/capture}

{capture assign=footer_left}
 {$ep_global_eross_footer_left}
{/capture}

{* Local placeholders *}
{capture assign=content}

{if isset($EP.page.properties.headerimageurl)}

 <div id="heading" class="heading-2 background fixed" data-minheight="200" data-bg="{$EP.page.properties.headerimageurl}">
  <div class="container">
   <h3 class="large light page-heading top-30 bottom-5">
    {$EP.page.title}{* $EP.page.tittel *}
   </h3>
   <h5 class="light">{$EP.page.beskrivelse}</h5>
  </div> 
  <div class="bgshadow"></div>
  </div>
{elseif $EP.page.properties.showheader == "true"}
 <div id="heading" class="heading-3">
  <div class="container">
   <h2 class="page-heading">
    {$EP.page.title}
   </h2>
  </div> 
  <div class="bgshadow"></div>
 </div>
{/if}
 <div class="container main-content{if $EP.page.properties.sidebarleft == "true"} sidebar-content" id="sidebar-content"{else}"{/if}>
 {if $EP.page.properties.sidebarnone == "true"}
  <div class="single" id="content">
   {$ep_documentcontent}
  </div>
 {else}
  <div class="row">
   <div class="col-lg-8 col-md-8 single" id="content">
    {$ep_documentcontent}
   </div><!-- // #content -->

   <div class="col-lg-3 col-md-3 top-30-sm top-30-xs col-lg-offset-1 col-md-offset-1" id="sidebar">
    {$aside}
    {$ep_documentcontent_right}
   </div>
  </div>
 {/if}
 </div>
{/capture}

{* Include page *}
{include file="eross-page-generic.tpl"}

 

Generisk sidemal

<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  {$header}

  <!-- Bootstrap core CSS -->
  <link href="/acf/global/common/sites/eross/styles/bootstrap.css" rel="stylesheet">

  <!-- jQuery load -->
  {if !$smartedit}
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" ></script>
  {/if}

  <!-- Custom styles for this template -->
  <link href="/acf/global/common/sites/eross/styles/style.css" rel="stylesheet">
  <link href="/acf/global/common/sites/eross/styles/plugin.css" rel="stylesheet">
  <link href="/acf/global/common/sites/eross/styles/font-awesome.min.css" rel="stylesheet">
  <link href="/acf/global/common/sites/eross/styles/animate.min.css" rel="stylesheet">
  <link href="/acf/global/common/sites/eross/styles/responsive.css" rel="stylesheet">
  {*<link href="/acf/global/common/sites/eross/styles/color/nb.css" rel="stylesheet">*}
  <link href="/acf/global/common/sites/eross/styles/screen.css" rel="stylesheet">

  <!-- Revolutions slider -->
  <link href="/acf/global/common/sites/eross/rs-plugin/css/settings.css" rel="stylesheet">
  <link href="/acf/global/common/sites/eross/rs-plugin/css/captions.css" rel="stylesheet">

  <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
   <!--[if lt IE 9]>
    <script src="/acf/global/common/sites/eross/scripts/html5shiv.js"></script>
    <script src="/acf/global/common/sites/eross/scripts/respond.min.js"></script>
   <![endif]-->

  {if $smartedit}
   <link href="/acf/global/common/sites/eross/styles/smartedit.css" rel="stylesheet">
  {/if}

 </head>

<body>
<header id="header">
 <div class="top-header">
  <div class="container">
   <div class="row">
    <div class="col-lg-6 col-md-6 top-header-left">
     {$head_left}
    </div><!-- // .top-header-left -->

    <div class="col-lg-6 col-md-6 text-right top-header-right">

     <div class="header-search pull-right visible-lg visible-md" id="header-search">
      <form method="get" id="searchform" action="/sok/">
       <div class="header-search-input-wrap"><input class="header-search-input" placeholder="Skriv inn sokeord ..." type="text" value="" name="s" id="s"/></div>
       <input class="header-search-submit" type="submit" id="go" value=""><span class="header-icon-search"><i class="fa fa-search"></i></span>
      </form><!-- // #searchform -->
     </div><!-- // .header-search -->

     {*<ul class="social list-unstyled pull-right">
      <li class="facebook"><a data-toggle="tooltip" data-placement="bottom" title="Facebook Page" href="#"><i class="fa fa-facebook"></i></a></li>
      <li class="twitter"><a data-toggle="tooltip" data-placement="bottom" title="Follow us on Twitter" href="#"><i class="fa fa-twitter"></i></a></li>
      <li class="googleplus"><a data-toggle="tooltip" data-placement="bottom" title="Google Plus" href="#"><i class="fa fa-google-plus"></i></a></li>
      <li class="linkedin"><a data-toggle="tooltip" data-placement="bottom" title="LinkedIn" href="#"><i class="fa fa-linkedin"></i></a></li>
      <li class="rss"><a data-toggle="tooltip" data-placement="bottom" title="RSS News" href="#"><i class="fa fa-rss"></i></a></li>
     </ul><!-- // .social -->*}

    </div><!-- // .top-header-right -->

   </div><!-- // .row -->
  </div><!-- // .container -->
 </div><!-- // .top-header -->

 <div class="main-header">
  <div class="container logo-area">

   <h1 class="logo">
    <a href="/">
     EasyPublish CMS demoside
    </a>

    <span class="site-title">{$EP.page.navn}</span>

   </h1><!-- // #logo -->

   <div id="mainmenu" class="site-menu visible-lg visible-md right-menu">

    <div class="left-menu hide">
     <div class="left-menu-info">
      <form action="post">
       <input type="text" placeholder="Sok" name="s">
       <button><i class="fa fa-search"></i></button>
      </form>
     </div><!-- // .left-menu-info -->
    </div><!-- // .left-menu.hide -->

    {$menu_main}

   </div><!-- // .site-menu.right-menu -->

   <!-- Repsonsive Menu Trigger -->
   <a class="pull-right responsive-menu visible-sm visible-xs" href="#panel-menu" id="responsive-menu"><i class="fa fa-bars"></i></a>
   <!-- End Reposnvie Menu Trigger -->

  </div><!-- // .container -->
 </div><!-- // .main-header -->
</header><!-- // header -->

 {if $EP.page.isFrontpage != 1}	
  <div id="breadcrumb">
  <div class="container">
   <ul class="clearfix list-unstyled">
    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
     <a href="/" title="Forsiden" itemprop="url">
      <span itemprop="title">
       Forsiden
      </span>
     </a>
    </li>

    {foreach item=parentId from=$EP.page.parentIds|@array_reverse}                                                               
      {php}           
         $pageId   = (int)$this->_tpl_vars['parentId'];
         $pageName = '';
         $pageUrl  = '';                                           
         $pageClass = '';

         if($pageId > 0) {                                              
            $page = EP_Page::getById($pageId);
            $pageUrl    = $page->getEffectiveUrl($page->id);
            $pageName   = $page->title;                                            
         }

         $this->assign('pageId', $pageId);
         $this->assign('pageName', $pageName);
         $this->assign('pageUrl', strtolower($pageUrl));  
         $this->assign('pageClass', $pageClass);

      {/php}

   {if $pageId > 0}
    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
     <a href="{$pageUrl}" title="{$pageName}" itemprop="url" {if $pageId > 0}data-ep-page-id="{$pageId}"{/if}>
      <span itemprop="title">
       {$pageName}
      </span>
     </a>
    </li>
   {/if}
     {/foreach}

    {if $smarty.request.article_id > 0}
						
      {php}
        $pageId   = (int)$this->_tpl_vars['EP']['page']['id'];
        $pageName = '';
        $pageUrl  = '';                                           
        $pageClass = '';

        if($pageId > 0) {                                              
          $page       = EP_Page::getById($pageId);
          $pageUrl    = $page->getEffectiveUrl($page->id);
          $pageName   = $page->title;                                            
        }
        $this->assign('pageId', $pageId);
        $this->assign('pageName', $pageName);
        $this->assign('pageUrl', strtolower($pageUrl));                                      
      {/php}
						
						
      {if $smarty.request.article_id > 0}            
    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
     <a href="{$pageUrl}" title="{$pageName}" itemprop="url" {if $pageId > 0}data-ep-page-id="{$pageId}"{/if}>
      <span itemprop="title">
       {$pageName}
      </span>
     </a>
    </li>
				
      
    <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="last">
     <a href="{$pageUrl}" title="{$pageName}" itemprop="url" {if $pageId > 0}data-ep-page-id="{$pageId}"{/if}>
      <span itemprop="title">
       {$article.header}
      </span>
     </a>
    </li>
      {/if}

    {elseif $lastBreadcrumbTitle|trim != ''}
   <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="last">
    <a href="{$lastBreadcrumbUrl}" title="{$lastBreadcrumbTitle}" itemprop="url" data-ep-page-id="{$EP.page.id}">
     <span itemprop="title">
      {$lastBreadcrumbTitle}
     </span>
    </a>
   </li>
  {else}
   <li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="last">
    <a href="/{$EP.page.breadcrumb|lower}" title="{$EP.page.title}" itemprop="url" data-ep-page-id="{$EP.page.id}">
     <span itemprop="title">
      {$EP.page.title}
     </span>
    </a>
   </li>
  {/if} 

   </ul><!-- // .list-unstyled -->
  </div><!-- // .container -->
 </div><!-- // #breadcrumb -->
 {/if}

{$content}

<footer id="footer">
 <div id="footer-1" class="widget-area">
  <div class="container">
   <div class="row">

    <div class="widget quick-contact col-lg-9 col-md-9 bottom-30-sm bottom-30-xs">
     {$footer_left}
    </div><!-- // .widget -->

    <div class="widget col-lg-3 col-md-3 bottom-30-sm bottom-30-xs">
     {*<img src="/images/footer-logo.png" alt="">
     <p class="top-10">Eross Multiperpose HTML5 Template by EverisLabs. Creat unlimited unique layout with hundread of features.</p>*}
    </div><!-- // .widget -->

   </div><!-- // .row -->
  </div><!-- // .container -->
 </div><!-- // .widget-area -->
	
 <div class="credit">
  <div class="container">
   <div class="row">

    <div class="col-lg-6 col-md-6">
     <span>Design by <a href="#">EverisLabs</a></span>
     <span>Powered by <a href="http://www.easypublish.no/" title="EasyPublish CMS">EasyPublish CMS</a>
    </div><!-- // -->

    <div class="col-lg-6 col-md-6 text-right">
     <ul class="list-unstyled">
      <li><a href="/personvern/">Personvern</a></li>
      <li><a href="/kontakt/">Kontakt oss</a></li>
     </ul>
    </div><!-- // -->

   </div><!-- // .row -->
  </div><!-- // .container -->
 </div><!-- // .credit -->
</footer><!-- // #footer -->

<!-- Core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="/acf/global/common/sites/eross/scripts/bootstrap.js"></script>
<script src="/acf/global/common/sites/eross/scripts/easing.js"></script>
<script src="/acf/global/common/sites/eross/scripts/superfish.js"></script>
<script src="/acf/global/common/sites/eross/scripts/fitvids.js"></script>
<script src="/acf/global/common/sites/eross/scripts/flexslider.js"></script>
<script src="/acf/global/common/sites/eross/scripts/mediaelement.js"></script>
<script src="/acf/global/common/sites/eross/scripts/isotope.js"></script>
{*<script src="/acf/global/common/sites/eross/scripts/easypiechart.js"></script>*}
{*<script src="/acf/global/common/sites/eross/scripts/caroufredsel.js"></script>*}
{if !$smartedit}
 <script src="/acf/global/common/sites/eross/scripts/jpanelmenu.js"></script>
{/if}
<script src="/acf/global/common/sites/eross/scripts/magnific.js"></script>

{*if !$smartedit}
<script src="/acf/global/common/sites/eross/scripts/twitter/tweet.js"></script>
{/if*}

<script src="/acf/global/common/sites/eross/scripts/functions.js"></script>

{*<!-- Revolutions slider -->
<script src="/acf/global/common/sites/eross/rs-plugin/js/jquery.themepunch.plugins.min.js"></script>
<script src="/acf/global/common/sites/eross/rs-plugin/js/jquery.themepunch.revolution.min.js"></script>
*}

</body>
</html>

 

 

 

23.06.14

Hjelp / support

Jeg finner ikke det jeg leter etter

Vår dokumentasjon er stadig under utvikling. Vi endrer og legger til nye kapitler og bøker etter hvert som EasyPublish CMS endrer og vokser. Skulle du likevel ikke finne det du leter etter så ta kontakt med oss via support@escio.no.

Jeg har funnet en feil

Hvis du har funnet en feil i vår dokumentasjon så ønsker vi å rette på den. Send oss et hint til support@escio.no.

Translate

You can translate this documentation by using Google Translate. Select your language:

×