handlebars VestaCP NGINX用于WordPress的Web模板在目录(博客)中使用强制HTTPS和WWW,上传到/ usr / local / vesta / data / templates / web / nginx

VestaCP NGINX用于WordPress的Web模板在目录(博客)中使用强制HTTPS和WWW,上传到/ usr / local / vesta / data / templates / web / nginx / php-fpm

README.md
Save these files and to upload to /usr/local/vesta/data/templates/web/nginx/php-fpm

Rename any instance of "blog" to the name of your wordpress directory.

After this, edit your domain in the VestaCP admin and choose the web template "wordpress2blog_rewrite".

www.webfwd.co.uk
wordpress2blog_rewrite.stpl
server {
    listen      %ip%:%web_ssl_port% ssl http2;
    server_name %domain_idn% %alias_idn%;
    root        %docroot%;
    index       index.php index.html index.htm;
    access_log  /var/log/nginx/domains/%domain%.log combined;
    access_log  /var/log/nginx/domains/%domain%.bytes bytes;
    error_log   /var/log/nginx/domains/%domain%.error.log error;

    ssl         on;
    ssl_certificate      %ssl_pem%;
    ssl_certificate_key  %ssl_key%;
    
    if ($http_host != %alias_idn%) {
        rewrite ^ https://%alias_idn%$request_uri permanent;
    }

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

    location = /robots.txt {
        allow all;
        log_not_found off;
        access_log off;
    }

    location /blog {
        try_files $uri $uri/ /blog/index.php?$args;

        if (!-e $request_filename)
        {
            rewrite ^(.+)$ /blog/index.php?q=$1 last;
        }

        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
            expires     max;
        }

        location ~ [^/]\.php(/|$) {
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;
            }

            fastcgi_pass    %backend_lsnr%;
            fastcgi_index   blog/index.php;
            include         /etc/nginx/fastcgi_params;
        }
    }

    location / {

        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
            expires     max;
        }

        location ~ [^/]\.php(/|$) {
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            if (!-f $document_root$fastcgi_script_name) {
                return  404;
            }

            fastcgi_pass    %backend_lsnr%;
            fastcgi_index   index.php;
            include         /etc/nginx/fastcgi_params;
        }
    }

    error_page  403 /error/404.html;
    error_page  404 /error/404.html;
    error_page  500 502 503 504 /error/50x.html;

    location /error/ {
        alias   %home%/%user%/web/%domain%/document_errors/;
    }

    location ~* "/\.(htaccess|htpasswd)$" {
        deny    all;
        return  404;
    }

    location /vstats/ {
        alias   %home%/%user%/web/%domain%/stats/;
        include %home%/%user%/web/%domain%/stats/auth.conf*;
    }

    include     /etc/nginx/conf.d/phpmyadmin.inc*;
    include     /etc/nginx/conf.d/phppgadmin.inc*;
    include     /etc/nginx/conf.d/webmail.inc*;

    include     %home%/%user%/conf/web/nginx.%domain_idn%.conf*;
}
wordpress2blog_rewrite.tpl
server {
    listen      %ip%:%web_port%;
    server_name %domain_idn% %alias_idn%;
    return 301 https://%alias_idn%$request_uri;
}

handlebars LOPD提交复选框

authentication.tpl
<div class="submit clearfix">
	<input type="hidden" name="email_create" value="1" />
	<input type="hidden" name="is_new_customer" value="1" />
	{if isset($back)}<input type="hidden" class="hidden" name="back" value="{$back|escape:'html':'UTF-8'}" />{/if}
	<p class="checkbox" id="security_informations">
	     <input id="acepta_lopd_form" type="checkbox" value="1" {if isset($smarty.post.acepta_lopd_form) AND $smarty.post.acepta_lopd_form == 1}checked="checked"{/if}  name="acepta_lopd_form">
	      <label for="acepta_lopd_form">{l s='I agree with the'} </label> <a href="{$link->getCMSLink(Configuration::get('PS_CONDITIONS_CMS_ID'))}{if Configuration::get('PS_REWRITING_SETTINGS') == 1}&#63;{else}&amp;{/if}content_only=1" class="iframe">{l s='Privacy Policy'}</a> {l s='and I agree unconditionally.'}
	</p>
	<p class="required"><span><sup>*</sup>{l s='Required field'}</span></p>
	<script type="text/javascript">
	$(document).ready(function() {
	      $("a.iframe").fancybox({
	          'type' : 'iframe',
	          'width':900,
	          'height':600
	      });
	  });
	</script>
	<button type="submit" name="submitAccount" id="submitAccount" class="btn btn-default">
		{l s='Register'}
	</button>
	<a href="{$link->getPageLink('my-account', true)|escape:'html':'UTF-8'}" rel="nofollow" class="but but-default">{l s='Back'}</a>
</div>
		
		
		
		
		
		
		
		
<script type="text/javascript">
$('document').ready(function() {
    // desactivo boton envio
    $('#account-creation_form').submit(function() {
      if ($("#acepta_lopd_form").is(":checked")) {
        $('#submitMessage').hide()
        return true;
      } else  {
        alert ("{l s="If you agree to the terms of our Privacy Policy, please tick the box accepting the same."}");
        $('#submitMessage').show()
        return false;
      }
    });
});
</script>

handlebars 针对Dirndltopia的Shopware5模板自定义(修复了桌面上显示的移动菜单问题)。替换在这里:/ shopware5 / engine / Shopware / P.

针对Dirndltopia的Shopware5模板自定义(修复了桌面上显示的移动菜单问题)。替换在这里:/shopware5/engine/Shopware/Plugins/Local/Frontend/StylaSEO/Views/frontend/magazin/index.tpl

index.tpl
{extends file='parent:frontend/custom/index.tpl'}

{block name='frontend_index_header'}
    {include file='frontend/magazin/header.tpl'}
{/block}

{* Sidebar left *}
{block name='frontend_index_content_left'}
    {$smarty.block.parent}
    <style>
        /* hide on desktop version */
        @media (min-width: 768px) {
            aside.sidebar-left { display: none; }
        }
    </style>
{/block}

handlebars Styla Shopware 5 - Hide Left Block V2

插件自定义以隐藏左侧边栏元素。这将替换此文件:/shopware5/engine/Shopware/Plugins/Local/Frontend/StylaSEO/Views/frontend/magazin/index.tpl

index.tpl
{extends file='parent:frontend/custom/index.tpl'}

{block name='frontend_index_header'}
    {include file='frontend/magazin/header.tpl'}
{/block}

{block name="frontend_index_content_left"}
<style>
#gLeft { display:none; }

@media (min-width: 1024px) {
    .col-md-9 { width: 100%; }
}
</style>
{/block}

handlebars Styla Shopware 5 - 隐藏左侧块

插件自定义以隐藏左侧边栏元素。这将替换此文件:/shopware5/engine/Shopware/Plugins/Local/Frontend/StylaSEO/Views/frontend/magazin/index.tpl

index.tpl
{extends file='parent:frontend/custom/index.tpl'}

{block name='frontend_index_header'}
    {include file='frontend/magazin/header.tpl'}
{/block}

{block name="frontend_index_content_left"}
{/block}

handlebars 颜色选择器

颜色选择器<br/>

new.js
import Ember from 'ember';
 
export default Ember.Component.extend({
  modelColorObserver: Ember.observer('model.color',function(){
    this.set('color',this.get('model.color'));
  }),
  color: '#FFFFF',
  hexValue: Ember.observer('color',function(key, val) {
    if (arguments.length == 2) {
      if (val.length == 7)
        this.set('color', val);
    }
    return this.get('color');
  }),
  actions: {
    saveModel(model)
    {
      let _this = this;
      if(model.validate()) {
        model.set('color', _this.get('color'));
        let color = model.get('color');
        let c = color.substring(1);      // strip #
        let rgb = parseInt(c, 16);   // convert rrggbb to decimal
        let r = (rgb >> 16) & 0xff;  // extract red
        let g = (rgb >> 8) & 0xff;  // extract green
        let b = (rgb >> 0) & 0xff;  // extract blue
 
        let luma = 0.2126 * r + 0.7152 * g + 0.0722 * b; // per ITU-R BT.709
 
        if (luma < 130)
          model.set('whiteText', true);
        else
          model.set('whiteText', false);
 
        model.save().then(function () {
          toastr.success('Label sauvegardé');
          _this.sendAction('transition');
        }).catch(function (reason) {
          console.log(reason);
            toastr.error('Erreur lors de la sauvegarde');
        });
      }
    },
    selectCategory: function (category) {
      this.get('model').set('category', category.id);
    }
  },
  init(){
    this._super(...arguments);
    let color = this.get('model.color');
    this.set('color',color);
  },
  didInsertElement(){
    let color = this.get('model.color');
    let _this = this;
    this.$(".color-swatch").spectrum({
      showInput: false,
      showButtons: false,
      color: color,
      change: function(newColor) {
        _this.set('color', newColor.toHexString());
      }
    });
    this.$('.color-swatch').on("dragstop.spectrum", function(e, newColor) {
      _this.set('color', newColor.toHexString());
    });
  }
});
new .hbs
{{#fields.form-group label="app.tags.forms.fields.label" fieldName="label" errors=model.errors}}
    {{input class="form-control" name="label" type="text" value=model.label}}
{{/fields.form-group}}
<div style="height: 50px; width: 50px;
     border-radius: 4px;
     border: 1px solid #000;background-color: {{color}}" class='color-swatch'></div>
<div class='hex-input'>
    Hex: {{input type='text' value=color class='hex' placeholder='#00000'}}
</div>
{{#fields.form-group label="app.tags.forms.fields.category" fieldName="category" errors=model.errors}}
    {{#power-select searchEnabled=false selected=model.categoryObject options=model.categories onchange=(action "selectCategory") as |category|}}
        {{t category.label}}
    {{/power-select}}
{{/fields.form-group}}
<div class="form-group text-right m-t-lg">
    {{#link-to 'app.tags' class="btn btn-white" active=false }}{{t 'buttons.cancel'}}{{/link-to}}
    <button {{action 'saveModel' model}} class="btn btn-primary">{{t 'buttons.save'}}</button>
</div>
{{yield}}

handlebars PS 1.7 Block Cart定制:

阻止顶部购物车自定义显示所有购物车信息。

ps_shoppingcart.tpl
{**
 * 2007-2017 PrestaShop
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License 3.0 (AFL-3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/AFL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 * @author    PrestaShop SA <contact@prestashop.com>
 * @copyright 2007-2017 PrestaShop SA
 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
 * International Registered Trademark & Property of PrestaShop SA
 *}
<div id="_desktop_cart" class="col-lg-3 col-md-5 col-sm-12">
  <div class="blockcart cart-preview {if $cart.products_count > 0}active{else}inactive{/if}" data-refresh-url="{$refresh_url}">
    <div class="header">
      {if $cart.products_count > 0}
        <a rel="nofollow" href="{$cart_url}">      
          <i class="awesome-icons shopping-cart">&#xf07a;</i>
          <span class="hidden-sm-down">{l s='Cart' d='Shop.Theme.Checkout'}</span>
          <!-- <span class="cart-products-count">({$cart.products_count})</span> -->
        </a>
      {/if}


      <div class="mm_BtnDisplayPrev">
        {if $cart.products_count > 0} 
          <a href="{$cart_url}">{$cart.products_count} product{if $cart.products_count > 1}s{/if} <i class="awesome-icons"></i></a>
        {else}
          <a href="{$cart_url}">{$cart.products_count} product{if $cart.products_count > 1}s{/if} <i class="awesome-icons"></i></a>
        {/if}
      </div>      
    </div>
    <!-- mm_Display preview cart -->
    <div class="body cart-hover-content">
      <ul>
         {foreach from=$cart.products item=product}
         <li class="cart-wishlist-item">
         {include 'module:ps_shoppingcart/ps_shoppingcart-product-line.tpl' product=$product}
         </li>
         {/foreach}
      </ul>
      <div class="cart-subtotals">
       {foreach from=$cart.subtotals item="subtotal"}
       <div class="{$subtotal.type}">
       <span class="label">{$subtotal.label}:</span>
       <span class="value">{$subtotal.value}</span>
       </div>
       {/foreach}
      </div>
      <div class="cart-total">
       <span class="label">{$cart.totals.total.label}:</span>
       <span class="value">{$cart.totals.total.value}</span>
      </div>
      <div class="mm_blockcart_viewcrt">
       <a class="cart-wishlist-viewcart" href="{$cart_url}">view cart</a>       
     </div>     
    </div>
  </div>    
</div>

handlebars 修复Javascript未加载

修复Javascript未加载

header.tpl
ADD:


{if isset($js_defer) && !$js_defer && isset($js_files) && isset($js_def)}
    {$js_def}
    {foreach from=$js_files item=js_uri}
    <script type="text/javascript" src="{$js_uri|escape:'html':'UTF-8'}"></script>
    {/foreach}
{/if}

handlebars 处理酒吧模板

处理酒吧模板

HandleBarsTemplate.hbs
<script id="entry-template" type="text/x-handlebars-template">
  <div class="entry">
    <h1>{{title}}</h1>
    <div class="body">
      {{body}}
    </div>
  </div>
</script>

handlebars Quick'n'Dirty MODX 2.3.x image-TV-clearbutton(/manager/templates/default/element/tv/renders/input/image.tpl)

Quick'n'Dirty MODX 2.3.x image-TV-clearbutton(/manager/templates/default/element/tv/renders/input/image.tpl)

preview.md
![Preview how it looks in the MODX Revolution 2.3.x Manager](http://www.agency1.org/images/clearbuttonquickfixpreview.png)
image.tpl
<style>
    .clearImageTV + .x-panel.modx-panel.x-panel-noborder{
     margin-left: 30px;
     margin-top: -34px;
    }
</style>

<div id="tvbrowser{$tv->id}"></div>
<div id="tv-image-{$tv->id}"><a class="clearImageTV" href="#" onclick="javascript:Ext.getCmp('tvbrowser{$tv->id}').setValue('');document.getElementById('tv{$tv->id}').value='';document.getElementById('tv-image-preview-{$tv->id}').getElementsByTagName('img')[0].remove();"><i class="icon icon-2x icon-trash-o"></i></i></a></div>

<div id="tv-image-preview-{$tv->id}" class="modx-tv-image-preview">
    {if $tv->value}<img src="{$_config.connectors_url}system/phpthumb.php?w=400&src={$tv->value}&source={$source}" alt="" />{/if}
</div>
{if $disabled}
<script type="text/javascript">
// <![CDATA[
{literal}
Ext.onReady(function() {
    var fld{/literal}{$tv->id}{literal} = MODx.load({
    {/literal}
        xtype: 'displayfield'
        ,tv: '{$tv->id}'
        ,renderTo: 'tv-image-{$tv->id}'
        ,value: '{$tv->value|escape}'
        ,width: 400
        ,padding: 300
        ,msgTarget: 'under'
    {literal}
    });
});
{/literal}
// ]]>
</script>
{else}
<script type="text/javascript">
// <![CDATA[
{literal}
Ext.onReady(function() {
    var fld{/literal}{$tv->id}{literal} = MODx.load({
    {/literal}
        xtype: 'modx-panel-tv-image'
        ,renderTo: 'tv-image-{$tv->id}'
        ,tv: '{$tv->id}'
        ,value: '{$tv->value|escape}'
        ,relativeValue: '{$tv->value|escape}'
        ,width: 400
        ,allowBlank: {if $params.allowBlank == 1 || $params.allowBlank == 'true'}true{else}false{/if}
        ,wctx: '{if $params.wctx}{$params.wctx}{else}web{/if}'
        {if $params.openTo},openTo: '{$params.openTo|replace:"'":"\\'"}'{/if}
        ,source: '{$source}'
    {literal}
        ,msgTarget: 'under'
        ,listeners: {
            'select': {fn:function(data) {
                MODx.fireResourceFormChange();
                var d = Ext.get('tv-image-preview-{/literal}{$tv->id}{literal}');
                if (Ext.isEmpty(data.url)) {
                    d.update('');
                } else {
                    {/literal}
                    d.update('<img src="{$_config.connectors_url}system/phpthumb.php?h=400&src='+data.url+'&wctx={$ctx}&source={$source}" alt="" />');
                    {literal}
                }
            }}
        }
    });
    MODx.makeDroppable(Ext.get('tv-image-{/literal}{$tv->id}{literal}'),function(v) {
        var cb = Ext.getCmp('tvbrowser{/literal}{$tv->id}{literal}');
        if (cb) {
            cb.setValue(v);
            cb.fireEvent('select',{relativeUrl:v});
        }
        return '';
    });
});
{/literal}
// ]]>
</script>
{/if}