template-engine

Manually control <head> markup in Joomla

狂风中的少年 提交于 2019-12-06 03:52:57
Is there a way to manually configure the contents of the <head> section of the site in Joomla 3.1? I want to use the templating system for the entire markup of the page, including everything between <html></html> . I just read this: http://forum.joomla.org/viewtopic.php?f=466&t=230787 and I am astonished at the response. Surely this is template/data separation 101. Has this been fixed in the latest Joomla release? If you are planning for a template development and you need all your template data get separated from Joomla libraries or core file (the head section). Normally the head section

Call play2 template with variable arguments of type Html

不问归期 提交于 2019-12-06 03:45:02
How can I call a template with a variable number of arguments that have Html type in play? I created a template in play2 defined like the following: @(tabs: Html*) <div class="btn-group" style="margin-bottom:20px"> @for((tab,index) <- tabs.zipWithIndex){ <a class="btn btn-mini btn-info active" id="display-hierarchy-@index" href="javascript:void(0)"><i class="icon icon-random icon-white"></i></a> } </div> @for((tab,index) <- tabs.zipWithIndex){ <div id="display-hierarchy-tab-@index" class="onetab"> @tab </div> } I tried to call it like @views.html.tabs({ <a>tab1</a> },{ <a>tab2</a> }) I tried

How to render doT.js templating in nodejs?

和自甴很熟 提交于 2019-12-06 03:31:06
问题 Hi I would like to know how can I render output in dot.js templating engine. I think it's a generic question about nodejs templating.(read comments for more info). The reason why I chose this template engine instead of jade or ejs is because it seems the fastest engine around. Here is my app.js: var express = require('express'), app = express.createServer(), doT = require('doT'), pub = __dirname + '/public', view = __dirname + '/views'; app.configure(function(){ app.set('views', view); app

template engine implementation

ぃ、小莉子 提交于 2019-12-06 03:03:40
I am currently building this small template engine. It takes a string containing the template in parameter, and a dictionary of "tags,values" to fill in the template. In the engine, I have no idea of the tags that will be in the template and the ones that won't. I am currently iterating (foreach) on the dictionnary, parsing my string that I have put in a string builder, and replacing the tags in the template by their corresponding value. Is there a more efficient/convenient way of doing this? I know the main drawback here is that the stringbuilder is parsed everytime entirely for each tag,

Syntax Error with John Resig's Micro Templating after changing template tags <# {% {{ etc

不羁岁月 提交于 2019-12-06 02:22:09
问题 I'm having a bit of trouble with John Resig's Micro templating. Can anyone help me with why it isn't working? This is the template <script type="text/html" id="row_tmpl"> test content {%=id%} {%=name%} </script> And the modified section of the engine str .replace(/[\r\t\n]/g, " ") .split("{%").join("\t") .replace(/((^|%>)[^\t]*)'/g, "$1\r") .replace(/\t=(.*?)%>/g, "',$1,'") .split("\t").join("');") .split("%}").join("p.push('") .split("\r").join("\\'") + "');}return p.join('');"); and the

Express.js custom template engine (plate)

旧街凉风 提交于 2019-12-06 02:02:40
问题 I am trying to get plate template engine to work with express.js. My initial attempt was this: app.register('.html', { compile: function (str, options) { var template = new plate.Template(str); return function(locals) { return template.render(locals, function(err, data) { return data; }); } } }); I see that the problem is that template.render doesn't return anything (undefined) but passes the data to a callback. I'm not sure how to make it work in this case as Express expects the compile

ASP.MVC: Implementing a non-templated view engine?

两盒软妹~` 提交于 2019-12-06 00:51:17
I'm fairly new to ASP.MVC. For our new Web application I'm considering between two options for view engines: Using some of the available view engines (the default one, NVelocity, Brail, etc.) as a primary view code generator. Implementing an application-specific C# DSL for generating HTML code so that the main bulk of the view code is stored in C# classes (using some sort of smart HTML generation like the one described by Jimmy Bogard ). The idea behind 2. would be to reduce the need for writing direct HTML code each time a new view is needed, but I'm not sure if this is a good approach. One

Rendering C# Objects to Html

大城市里の小女人 提交于 2019-12-05 23:05:30
问题 We have bunch of Domain Entities which should be rendered to an html format, which shows their detail in a pop up window. I would be glad to do something like this: Product product = new Product(...); product.ToHtml(); // or: HtmlRenderer.Render(Product); but my main problem is how to do this stuff from behind. I have 3 different answers: 1. Render By Code: I can simply write my code for rendering the Html inside the ToHtml Method (C#) - the problem it is that it is too static. if you would

Is it possible to use Razor as a standalone library (without any asp.net business) on OSX (via Mono)

 ̄綄美尐妖づ 提交于 2019-12-05 15:38:33
I would like to write a proof of concept MonoMac app which renders html "Views" using c# and Razor. Is this possible? If not, does anyone recommend any other Templating engines that compare to the simplicity of Razor. I don't mind writing it in Objective-C if I have to, but Mono would be simpler. konrad.kruczynski I think you may be interested in this project. You just have to download zip which consists of two DLLs, reference them in your project and examples like these just works. Have in mind that you have to make 4.0 project. I have been testing this on Mono 2.10.5, however OS was Linux,

webpack html (ejs) include other templates

落爺英雄遲暮 提交于 2019-12-05 11:34:44
So this is my webpack config : import path from 'path'; var HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: { index: './dev/index.js' }, output: { path: path.join(__dirname, 'dist'), // publicPath: 'http://localhost:3000/', filename: 'bundle.js', chunkFilename: '[id].bundle.js' }, module: { loaders: [ { test: /\.js$/, exclude: path.resolve(__dirname, "node_modules"), loader: 'babel-loader' } ] }, plugins: [ new HtmlWebpackPlugin({ hash: true, template: 'ejs!./dev/index.ejs', inject: 'body' }) ] }; My index.ejs file : <!DOCTYPE html> <html lang="en"> <head> <meta