daily pastebin goal
53%
SHARE
TWEET

Bootstrap4 Core

stom66 Nov 14th, 2017 (edited) 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {strip}
  2. {*
  3. *   Template name: Bootstrap4 Core
  4. *   -------------------------------------
  5. *
  6. *   This is the main section of the regular templates. It inherits settings from the "Bootstrap4 Settings"
  7. *   template and most basic customisations can be done there.
  8. *
  9. *   Note: this template should not be set to "listable" nor should it be the "default" template in
  10. *   CMSMS. Instead, either the "Bootstrap4 Triple Cols" or "Bootstrap4 Nonuple Cols" templates should
  11. *   be used as the default as they both further extend this template.
  12. *
  13. *   Part of the CMSMS Bootstrap4 template by stom | stom66.co.uk
  14. *}
  15. {process_pagedata}
  16. {$debug_mode=false scope=global}
  17. {***************** Area 1 [processed first] *****************}
  18. {block name='top'}
  19.  
  20.     {include file="cms_template:Bootstrap4 Settings"}
  21.  
  22.     {* Check for module availability *}
  23.         {cge_have_module module='CGSmartImage'  assign='mod_CGSmartImage'}
  24.         {cge_have_module module='Markdown'      assign='mod_Markdown'}
  25.         {cge_have_module module='SitemapMgr'    assign='mod_SitemapMgr'}
  26.         {cge_have_module module='CGWebPush'     assign='mod_CGWebPush'}
  27.  
  28.     {* Setup page content and attributes *}
  29.         {$footer_js         = "{content block='footer_js' label='Footer JavaScript' tab='zz_2logic_tab__'}" scope=global}
  30.                             {* I know this cludge is frowned upon. Don't tell Calguy. *}
  31.  
  32.         {$content1          = "{content tab='Content 1'}" scope=global}
  33.         {$content1_style    = "{content block='content1_style' label='Class' tab='Content 1' oneline='true'}"|default:"col-12" scope=global}
  34.         {$content1_disable_markdown = "{content block='content1_disable_markdown' oneline='true' label='Content 1: Disable Markdown?' tab='Content 1'}" scope=global}
  35.                             {* I know this cludge is frowned upon. Don't tell Calguy. *}
  36.  
  37.         {$body_class        = "{content block='body_class' label='Body class' oneline='true'}"|default:"" scope=global}
  38.         {$container_class   = "{content block='container_class' label='Container class' oneline='true'}"|default:"container" scope=global}
  39.         {$row_class         = "{content block='row_class' label='Row class' oneline='true'}"|default:"row" scope=global}
  40.  
  41.         {$meta_description  = "{content block='meta-description' wysiwyg='false' oneline='true' label='Meta description' tab='Meta data'}" scope=global}
  42.         {$meta_keywords     = "{content block='meta-keywords' wysiwyg='false' oneline='true' label='Meta keywords' tab='Meta data'}" scope=global}
  43.         {$page_description  = $meta_description|default:$content1|markdown|strip_tags|strip|trim|truncate:180 scope=global}
  44.         {$page_keywords     = $meta_keywords|default:$my_keywords}
  45.  
  46.         {$canonical_url     = $canonical_url|default:"{$content_obj->GetURL()|lower|default:''}" scope=global}
  47.         {$page_breadcrumbs  = $page_breadcrumbs|default:"{nav_breadcrumbs|strip|trim}" scope=global}
  48.         {$page_image        = $page_image|default:"{$default_image}" scope=global}
  49.         {$page_lang         = $page_lang|default:"{cms_get_language}" scope=global}
  50.         {$page_modified     = $page_modified|default:"{modified_date format='%Y-%m-%dT%T%z'}" scope=global}
  51.         {$page_robots       = $page_robots|default:"index,follow" scope=global}
  52.         {$page_title        = $page_title|default:"{title}" scope=global}
  53.         {$page_type         = $page_type|default:"website" scope=global}
  54.         {$root_url          = $root_url|default:"{root_url}" scope=global}
  55.         {$site_name         = $site_name|default:"{sitename}" scope=global}
  56.  
  57.     {* Set additional page classes *}
  58.         {$navbar_classes = "navbar navbar-expand-sm"}
  59.         {if $default_footer_style=="sticky"}
  60.             {$body_class="{$body_class} sticky-footer"}{/if}
  61.  
  62.         {if !empty($navbar_color)}
  63.             {$navbar_classes = "{$navbar_classes} navbar-{$navbar_color}"}{/if}
  64.  
  65.         {if !empty($navbar_background_color)}
  66.             {$navbar_classes = "{$navbar_classes} bg-{$navbar_background_color}"}{/if}
  67.  
  68.         {if $default_navbar_style   =="fixed"}
  69.             {$navbar_classes = "{$navbar_classes} fixed-top"}{/if}
  70.  
  71.         {if $default_navbar_style   =="default"}
  72.             {$navbar_classes = "{$navbar_classes} rounded my-5"}{/if}
  73.  
  74.         {if $default_navbar_style   =="top"}
  75.             {$navbar_classes = "{$navbar_classes} mb-4"}{/if}
  76.  
  77.     {*  Include the JS files used in the template.
  78.         Locations assume installation via npm to /assets directory  of the following modules:
  79.          - jQuery@3.2.1
  80.          - popover.js
  81.          - bootstrap@4.0.0-beta.2
  82.          - lightbox2
  83.     *}
  84.         {cgjs_require jsfile="assets/node_modules/jquery/dist/jquery.min.js"}
  85.         {cgjs_require jsfile="assets/node_modules/popper.js/dist/umd/popper.min.js"}
  86.         {cgjs_require jsfile="assets/node_modules/bootstrap/dist/js/bootstrap.min.js"}
  87.         {cgjs_require jsfile="assets/node_modules/lightbox2/dist/js/lightbox.min.js"}
  88.  
  89.     {* End of "top" block *}
  90. {/block}
  91. {/strip}<!doctype html>
  92. <html lang="{$page_lang}"{if $default_footer_style=="sticky"} class="sticky-footer"{/if}>
  93. <head>{***************** Area 2 [processed third] *****************}
  94.   <!-- Basic declarations -->
  95.     <meta charset="utf-8">
  96.     <meta http-equiv="x-ua-compatible"  content="ie=edge">
  97.     <meta name="viewport"               content="width=device-width, initial-scale=1, shrink-to-fit=no">
  98.     <title>{$page_title} - {$site_name}</title>
  99.  
  100.   <!-- Meta data -->
  101.     <meta name="application-name"       content="{$site_name}" />
  102.     <meta name="author"                 content="{$author_name}" />
  103.     <meta name="copyright"              content="Copyright (C) {$author_name}, All Rights Reserved" />
  104.     <meta name="description"            content="{$page_description}" />
  105.     <meta name="generator"              content="CMS Made Simple - Copyright (C) 2004-{$smarty.now|date_format:'%Y'} CMSMS™. All rights reserved." />
  106.     <meta name="keywords"               content="{$page_keywords}" />
  107.     <meta name="robots"                 content="{$page_robots}" />
  108.  
  109.   <!-- Open graph meta data -->
  110.     <meta property="og:description"     content="{$page_description}" />
  111.     <meta property="og:image"           content="{$page_image}" />
  112.     <meta property="og:site_name"       content="{$site_name}" />
  113.     <meta property="og:title"           content="{$page_title}" />
  114.     <meta property="og:type"            content="{$page_type}" />
  115.     <meta property="og:updated_time"    content="{$page_modified}" />
  116.     <meta property="og:url"             content="{$canonical_url}" />
  117.  
  118.   <!-- Twitter meta data -->
  119.     <meta name="twitter:card"           content="summary" />
  120.     <meta name="twitter:creator"        content="{$twitter_handle}" />
  121.     <meta name="twitter:description"    content="{$page_description}" />
  122.     <meta name="twitter:domain"         content="{root_url}" />
  123.     <meta name="twitter:image"          content="{$page_image}" />
  124.     <meta name="twitter:site"           content="{$site_name}" />
  125.     <meta name="twitter:title"          content="{$page_title}" />
  126.     <meta name="twitter:url"            content="{$canonical_url}" />
  127.     <meta name="tweetmeme-title"        content="{$page_title}" />
  128.  
  129. {if !empty($google_site_key)}
  130.   <!-- Google meta data -->
  131.     <meta name="google-site-verification" content="{$google_site_key}" />
  132.  
  133. {/if}
  134. {if (!empty($fb_app_id) && $fb_app_id > 0) || !empty($fb_admins)}
  135.   <!-- Facebook meta data -->
  136. {if !empty($fb_app_id) && $fb_app_id > 0}   <meta property="fb:app_id" content="{$fb_app_id}" />
  137. {/if}
  138.     {if !empty($fb_admins)}<meta property="fb:admins" content="{$fb_admins}" />
  139. {/if}
  140.  
  141. {/if}
  142. {if !empty($manifest_alias)}
  143.   <!-- Web manifest -->
  144.     <link rel="manifest" href="{root_url}/{$manifest_alias}">
  145.  
  146. {/if}
  147.   <!-- Stylesheets -->
  148.     {cms_stylesheet|strip}
  149.  
  150.   <!-- HTML5 Shiv for IE -->
  151.     <!--[if lt IE 9]>
  152.         <script src="https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.js"></script>
  153.     <![endif]-->
  154.  
  155.   <!-- Favicons and app icons -->
  156. {if !empty($favicon_ico)}   <link rel="shortcut icon"                                   href="{$favicon_ico}" />
  157. {/if}
  158. {if $mod_CGSmartImage && !empty($favicon_png)}{* Check for CGSmartImage and print the various favicons *}
  159.     <link rel="icon"    type="image/png"    sizes="196x196"     href="{CGSmartImage src=$favicon_png notag=1 force_ext=1 noembed=1 filter_resizetofit='196,196,#ff000,126'}" />
  160.     <link rel="icon"    type="image/png"    sizes="128x128"     href="{CGSmartImage src=$favicon_png notag=1 force_ext=1 noembed=1 filter_resizetofit='128,128,#ff000,126'}" />
  161.     <link rel="icon"    type="image/png"    sizes="16x16"       href="{CGSmartImage src=$favicon_png notag=1 force_ext=1 noembed=1 filter_resizetofit='16,16,#ff000,126'}"  />
  162.     <link rel="icon"    type="image/png"    sizes="32x32"       href="{CGSmartImage src=$favicon_png notag=1 force_ext=1 noembed=1 filter_resizetofit='32,32,#ff000,126'}"  />
  163.     <link rel="apple-touch-icon"                                href="{CGSmartImage src=$favicon_png notag=1 force_ext=1 noembed=1 filter_resizetofit='60,60,#ff000,126'}" />
  164.     <link rel="apple-touch-icon"            sizes="76x76"       href="{CGSmartImage src=$favicon_png notag=1 force_ext=1 noembed=1 filter_resizetofit='76,76,#ff000,126'}" />
  165.     <link rel="apple-touch-icon"            sizes="120x120"     href="{CGSmartImage src=$favicon_png notag=1 force_ext=1 noembed=1 filter_resizetofit='120,120,#ff000,126'}" />
  166.     <link rel="apple-touch-icon"            sizes="152x152"     href="{CGSmartImage src=$favicon_png notag=1 force_ext=1 noembed=1 filter_resizetofit='152,152,#ff000,126'}" />
  167.     <meta name="msapplication-TileImage"                        content="{CGSmartImage src=$favicon_png notag=1 noembed=1 force_ext=1 filter_resizetofit='144,144,#ff000,126'}" />
  168. {/if}
  169.  
  170.   <!-- User agent theme declarations -->
  171.     <meta name="apple-mobile-web-app-capable"           content="yes">
  172.     <meta name="apple-mobile-web-app-status-bar-style"  content="{$apple_mobile_style}">
  173.     <meta name="msapplication-navbutton-color"          content="{$theme_color}">
  174.     <meta name="theme-color"                            content="{$theme_color}" />
  175.  
  176. {if $mod_SitemapMgr}
  177.   <!-- Link to sitemap -->
  178.     <link rel="sitemap" type="application/xml" title="Sitemap" href="{root_url}/sitemap.xml" />
  179. {/if}
  180.  
  181.   <!-- Declare canonical URL -->
  182.     <link rel="canonical" href="{$canonical_url}" />
  183.  
  184.   <!-- Other global meta data -->
  185.     {metadata|strip|trim}
  186. </head>
  187. <!-- <neck></neck> -->{***************** Area 3 [processed second] *****************}
  188. <body class="{$body_class|trim}">
  189.     {if $default_navbar_style!=="none"}
  190.         {Navigator}
  191.     {/if}
  192.  
  193.     <main{if $default_navbar_style=="fixed"} class="mt-5 pt-5"{/if}>
  194.         {block name='content'}
  195.             <div class="{$container_class}">
  196.                 <div class="{$row_class}">
  197.                     <div class="col-md-12">
  198.                         <h2>{$page_title}</h2>
  199.                         {$content1}
  200.                     </div>
  201.                 </div>
  202.             </div>
  203.         {/block}
  204.     </main>
  205.  
  206.     {if $default_footer_style!=="none"}
  207.     <footer{if $default_footer_style=="sticky"} class="sticky-footer"{/if}>
  208.         <div class="container">
  209.             <div class="row">
  210.                 <div class="col-12 text-center pt-1">
  211.                     &copy; {sitename}
  212.                     <i class="fa fa-desktop primary pl-5" aria-hidden="true"></i>
  213.                     <span class="text-small-caps">
  214.                         <span class="d-inline d-sm-none">xs</span>
  215.                         <span class="d-none d-sm-inline d-md-none">sm</span>
  216.                         <span class="d-none d-md-inline d-lg-none">md</span>
  217.                         <span class="d-none d-lg-inline d-xl-none">lg</span>
  218.                         <span class="d-none d-xl-inline">xl</span>
  219.                     </span>
  220.                 </div>
  221.  
  222.                 <div class="col-12 pt-1">
  223.                     {if $debug_mode}
  224.                         <hr /><ul>
  225.                         <li><b>$site_name:</b> {$site_name}</li>
  226.                         <li><b>$canonical_url:</b> {$canonical_url}</li>
  227.                         <li><b>$root_url:</b> {$root_url}</li>
  228.  
  229.                         <li><b>$page_description:</b> {$page_description}</li>
  230.                         <li><b>$page_keywords:</b> {$page_keywords}</li>
  231.                         <li><b>$page_image:</b> {$page_image}</li>
  232.                         <li><b>$page_lang:</b> {$page_lang}</li>
  233.                         <li><b>$page_modified:</b> {$page_modified}</li>
  234.                         <li><b>$page_title:</b> {$page_title}</li>
  235.  
  236.                         <li><b>$theme_url:</b> {$theme_url}</li>
  237.                         <li><b>$theme_color:</b> {$theme_color}</li>
  238.                         <li><b>$favicon_png:</b> {$favicon_png}</li>
  239.                         <li><b>$favicon_ico:</b> {$favicon_ico}</li>
  240.                         <li><b>$twitter_handle:</b> {$twitter_handle}</li>
  241.                         <li><b>$author_name:</b> {$author_name}</li>
  242.                         </ul><hr />
  243.                     {/if}
  244.                 </div>
  245.             </div>
  246.         </div>
  247.     </footer>
  248.     {/if}
  249.  
  250.   <!-- Include compiled minified JS -->
  251.     {cgjs_render no_css=1}
  252. {if !empty($google_analytics_key)}
  253.   <!-- Google Analytics -->
  254.     <script async src="https://www.googletagmanager.com/gtag/js?id={$google_analytics_key}"></script>
  255.     <script>
  256.         window.dataLayer = window.dataLayer || [];
  257.         function gtag(){  
  258.             dataLayer.push(arguments);
  259.         }
  260.         gtag('js', new Date());
  261.         gtag('config', '{$google_analytics_key}');
  262.     </script>
  263.  
  264. {/if}
  265. {if !empty($footer_js)}
  266.     {$footer_js}
  267.  
  268. {/if}
  269. </body>
  270. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top