templating

Using tinybutstrong templating system, how do I have a (secondary) mysql query (sub-block), inside another mysql query (block)?

This is the code that works well. $TBS->MergeBlock("items",$conn,"SELECT * FROM items WHERE categoryid = $getcategory"); and it has a good job of looping the items with no problem. <tr id="itemid_[items.id;block=tr]"> <td height="30"> <!-- <img src="move.png" align="left" style="margin-r...

How can I create a silverlight combobox that drops down a treeview?

I'm trying to create a user control that is a combobox that, when opened, presents a treeview of heirarchal data. I created the user control and replaced a portion of the template in Popup with: <ScrollViewer x:Name="ScrollViewer" BorderThickness="0" Padding="1"> <sdk:TreeView x:Name="Tree"> </sdk:TreeView> <...

Is there a html-only templates system for php?

I have started coding in clojure, and I'm really impressed by Enlive. One thing that I really like about it is that Enlive uses html-only templates. So a template is a file with html in it, ending in .html, simple as that. It gets parsed into a dom tree and then that dom tree is manipulated by clojure/enlive, combined, made dynamic, e...

Mustache.js - accepts inputs as vars, but not as ajax gets: How to import or troubleshoot

Using this as the example: http://mustache.github.com/#demo, the template and json can functionally be moved to a var: template = '<h1>{{header}}</h1>{{#items}}{{#first}}<li><strong>{{name}}</strong></li> {{/first}}{{#link}} <li><a href="{{url}}">{{name}}</a></li> {{/link}}{{/items}}{{#empty}} <p>The list is empty.</p>{{/empty}}'; Thi...

How do I get some string values from Pylons controller be assigned to JavaScript variables with Mako?

I'm developing under Pylons using Mako templates. The problem is that I need to assign a string from some attribute of tmpl_context to a JavaScript variable in a page body. The additional problem is that this string can be quite arbitrary, ie can contain such characters like ", ', <, >, etc... Is there a common way to do such assignment?...

What does a client side javascript templating framework offer ?

What is the use of frameworks like PURE or jQote etc. I can do dynamic things in plain javascript or JQuery using AJAX calls or an advanced library like DWR. What new stuff do these templating frameworks bring to the table? I need to know since I have been asked to use a browser side templating framework without being explained why :( ...

Is it possible to use Razor View Engine outside asp.net

If I look at the Razor View Engine, then I see a very nice and concise syntax that is not particularly tied to generating html. So I wonder, how easy would it be to use the engine outside asp.net in a "normal" .net environment for example to generate text, code,... Any pointer, example, comment or explanation is welcome. ...

How does one make a template system (like Tumblr's) in Rails?

I've looked at Liquid and the like, but I cannot find a way to make a "one file" template that can handle all situations. I don't want to reinvent the wheel, but I will if I cannot find an existing solution. The template system looks like this: {block:Text} <li class="post text"> {block:Title} <h3><a href="{Perm...

Need some advice/suggestions on template syntax.

Heya! I've coded a small php template parser, so templates can be easily parsed, and the variables within the templates are like {variable_name} e.g. <title>{title}</title> Can you suggest me possible if/else statement syntax? I've thought of doing something like: {if {logged_in}: TRUE} You're logged in... {else} You're not... {/if...

Warning-free Templating in C

Transitioning from C++, I am now learning the dark art of C and have developed the following code to replace my need for templating. In the bottom example, I have implemented your garden-variety Node structure in such a way that it can be used to store any data type. Consider the following... // vptr.c #include <stdio.h> struct Node {...

set path for code generator in Visual Studio

I set the stringPath to the .edmx file like stringPath = @"Solution\Folder\Model.edmx" It works in one solution but not in another. All the text templating code is the same. In the solution where it doesn't work, it trys to find the file here: .....Microsoft Visual Studio 10.0\Common7\IDE\Solution\Folder\Model.edmx. I was wondering wh...

YUI 3 html templating

Is there any way to create HTML markup in YUI like: <div id={DivId}> <p class={pClass}> <span class={spanClass}> {Content} </span> </p> </div> ...

What is a templating language?

I was reading somewhere that PHP is a templating language. What is exactly a templating language? What makes PHP one? What are the other templating languages? ...