templating

Passing options to templates in knockout 1.3

為{幸葍}努か 提交于 2019-12-12 08:54:36
问题 In knockoutjs 1.2.1 I could do: <div data-bind="template: {name: 'Bar', foreach: persons, templateOptions:{fooMode: true} }"/> <script id='Bar'> {{if $item.fooMode}} FOO! {{/if}} </script> Which I have tried to translate to knockout 1.3.0beta as <div data-bind="template: {name: 'Bar', foreach: persons, templateOptions:{fooMode: true} }"/> <script id='Bar'> <span data-bind="if: $item.fooMode">FOO!</span> </script> But the new native template engine doesn't respect templateOptions. Is there

how to use Smarty better with PHP?

馋奶兔 提交于 2019-12-12 07:15:26
问题 I found that using Smarty with PHP, sometimes extra time will need to be used for 1) using quite different syntax than PHP itself 2) need to check small cases, because documentation doesn't give finer details, such as for "escape" http://www.smarty.net/manual/en/language.modifier.escape.php it doesn't say escape:"quotes" is for double quotes only or for single quotes as well, so you need to write code to test it. Also for the case of escape:"javascript" -- can't tell exactly what and how it

How to get a Hexo-built site variables in a pug template?

扶醉桌前 提交于 2019-12-11 16:15:51
问题 I have a Pug template (for what will become the root index.html ) which is supposed to just list the titles of my posts: p first line of the page ul each post in site.posts li= post.title p last line of the page When building the site I get in index.html <p>first line of the page</p> <ul> <li></li> <li></li> </ul> <p>last line of the page</p> I have two posts on this site and the two <li></li> suggest that I iterate over the right variable (and that the variable is known). How can I get the

intershop get date in .isml template

陌路散爱 提交于 2019-12-11 06:35:30
问题 I need to check the condition: <isif condition="#not ((Product:QLC_Enable EQ 'true') AND (Product:QLC_ValidTo > NOW) AND (Product:QLC_Quantity < 1))#"> <span class="items-in-stock align-left"> <isinclude template="product/inc/CC_StockStatus"/> </span> </isif> But it seems that it is incorrect to use this segment: Product:QLC_ValidTo > NOW Particularly the problem is the syntax for 'NOW'. I have no idea how it should be set and cannot find out in their documentation. Can anybody help? 回答1: I

Blade conditional extends

元气小坏坏 提交于 2019-12-11 02:12:34
问题 I know this seems like an answered question, but it is not (I hope). What I looking for is a way to extends or NOT a view: if the request is an ajax call the view does not extends nothing. Something like: @if(!Request::ajax()) @extends('navbar') @section('home') <div>"my content"</div> @stop @else <div>"my content"</div> @endif This is NOT what I looking for: @extends((( Request::ajax()) ? 'layouts.ajax' : 'layouts.default' )) I mean if the request is an ajax call, I want the view do not

knockoutjs afterRender issue in version 2, not apparent in version 1.2.X

╄→尐↘猪︶ㄣ 提交于 2019-12-10 17:04:55
问题 I have recently updated an existing project to KnockoutJS 2.0 from KnockoutJS 1.2.1 (although I started it using the previous version). Since updating I have noticed that afterRender seems to be firing before elements are actually fully within the html. I did a bit of looking around and it seems like this is the intended behaviour according to a few other questions around this area: Why are template divs showing as ":hidden" in afterRender? The problem manifests itself with Jquery Validate

Illustrator/SVG to JavaScript workflow? (A templating library?)

拥有回忆 提交于 2019-12-10 16:29:13
问题 When "Saving as SVG" in Illustrator, this is the typical result: <?xml version="1.0" encoding="iso-8859-1"?> <!-- Generator: Adobe Illustrator 15.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="841.89px" height="595.28px" viewBox="0 0 841.89 595.28" style=

javascript/jquery templating suggestions

泪湿孤枕 提交于 2019-12-10 16:19:16
问题 I am developing a large scale application highly dependent on javascript. Part of this will be displying information on screen. I am looking to display information on the ui and I am looking at using javascript templating to do such. I will be using the jquery framework. Any suggestions or recommendations to javascript/jquery templating frameworks? 回答1: It's not jQuery based, but according to performance tests on jsperf.com, the doT.js templating framework is consistently the fastest JS

Shopify liquid get related blog posts

喜夏-厌秋 提交于 2019-12-10 10:48:23
问题 In shopify I am using liquid templating to get blog posts which are related to products by their tags, like so: <ul> {% for article in blogs.blog.articles %} {% if article.tags contains product.handle %} <li><a href="{{ article.url }}"><p>{{ article.title }}</p></a></li> {% endif %} {% endfor %} </ul> However, if there are no related posts, I would like to display a message such as "No related posts!" My question is how would I do that? I have contemplated trying to get the articles into an

Tridion: Template Builder and Visual studio debugging

 ̄綄美尐妖づ 提交于 2019-12-10 05:44:25
问题 We are creating compound templates using Visual Studio 2008. While debugging, we attach to the process of template builder. However we are not able to locate the template builder process ID while attaching the process in VS 2008. This works well on our dev server where VS 2008, CMS(Tridion 2011 SP1) and Template builder are on the same server. But doesn't works if the VS2008 and Template Builder are installed on a machine other than CMS server. Is it a pre-requisite to have all (VS2008,