templates

Including template files and dynamically changing variables within them

To make life a little easier for myself I would like to build a very simple template engine for my projects. Something I had in mind was to have .html files in a directory that get included to a page using PHP when I want them. So a typical index.php would look like this: <?php IncludeHeader("This is the title of the page"); IncludeBod...

Template style is not setting some preferences.

I have a style template (below) that does not update some my custom control properties. ... <Style x:Name="KeyboardButton" TargetType="Controls:KeyboardButton"> ... <Setter Property="ArrowDirection" Value="Right" /> <Setter Property="ArrowBeginColor" Value="Red" /> <Setter Property="Template"> ... ArrowBeg...

What are your templating strategies?

I try to develop my own little framework. For this, I'd like to read up some templating techniques. I know that templating is a really complex topic, but knowing some strategies could help find the right one. Please, if you mention one, don't just write "smarty" for example. Write a little about the concept behind it. Let me start with...

separate php file as template - security hazard?

I was looking at templating systems for php, and I've come to believe that pure php code seems to be the solution I want to use. I'm the lone developer, so there's no designers who need a nerfed arena to work in. Template engines like smarty seem to suffer from the "Inner-platform effect". If I stick with good practices ( pre-computed ...

In Grails template namespace how do you use a template that is in another directory

Say I have a template called /sample/_mytemplate.gsp. If I want to call this template from the same directory I can use However, what if I am in another directory. Then what do I do? Say I'm in the view /sample2/mypage.gsp how do I call it? ...

Project-specific licenses in Netbeans using File Templates

I can't get project-specific licenses to work in my Netbeans File Templates. I have a template called "PHP File". The contents look like this... <?php <#assign licenseFirst = "/*"> <#assign licensePrefix = " * "> <#assign licenseLast = " */"> <#include "../Licenses/license-${project.license}.txt"> ?> I also added a file template to t...

Scope of the Pages in a Silverlight application

I have an app built with the Silverlight Navigation Application Template. I have a main form (e.g. MainPage.xaml) and a bunch of Silverlight Pages, which are swapped in and out of the main content area. In the MainPage.xaml, I have a DispatcherTimer which hits some Uri resources, regardless of which page I am on. Every now and then, i...

php template engine using %%variable%%

I'm looking at the PHP code for the interspire shopping cart and they make extensive use of template variables such as %%GLOBAL_variables%% and %%variable%%. I haven't seen those before and I'm trying to understand how they are defined and used. Does anyone know what template engine is involved and any documentation on it? thanks ...

C++ Templates and accessing namespaces

Hi, let's say I'm using a templated class with something simple like template <class T> class MyClass and I want to use elements from T's namespace, for example T could be string, and i wanted to use T::const_iterator myIterator; or something like that. How do I achieve that ? Probably it's not possible or very simple, but I'm...

GAE template code to check is item in the list

How to use "in" statement to check is item in the list or not. If I use: {% for picture in pictures %} {% if picture in article.pictures %} <input type="checkbox" checked="true" name="picture" value="{{ picture.key }}" /> {% else %} <input type="checkbox" name="picture" value="{{ picture.key }}" /> {% endif %} ...

weird problem with django templates

hi, while working on templates weird problem occured: when templates are being rendered (i guess), in code, right before the doctype, strange character is being placed. I call it "strange" because if I select it, copy it and try to paste nothing is pasted. This "dot" is seen only if I do "view source" in webkit browsers. now, layout br...

Can I use partial template specialization for a (non-member) function?

I'm trying to use partial template specialization on a (non-member) function, and I'm tripping up on the syntax. I've searched StackOverflow for other partial template specialization questions, but those deal with partial specialization of a class or member function template. For a starting point, I have: struct RGBA { RGBA(uint8 ...

C++ Force Template Parameter

I want this code to be possible. template<typename K, typename T, typename Comparer> class AVLTree { ... void foo() { ... int res = Comparer::compare(key1, key2); ... } ... }; Specifically, I want to force Comparer class to have a static int compare(K key1, K key2) function. I was thinking about using ...

Sharepoint: Modify the page template of views

Hi I have a sharepoint list with several views. I can modify the view pages (such as AllItems.aspx) via the sharepoint designer. However I would prefer to modify the underlying template instead. Now I could directly modify the default view page template located in templates\pages\viewpage.aspx but this would affect the whole sharepoint...

stack of characters, stack of character string, stack of integers, stack of integer arrays etc

I want to make a generic stack using the c++ templates. The prototype of the push method of stack is given by Void push( t* ptr) Where t is the template argument. Now the pointer ptr may point to an integer, or an array of integers, it may point to a single character or array of characters , it may point to a single double number or an a...

SFINAE to check for inherited member functions

Using SFINAE, i can detect wether a given class has a certain member function. But what if i want to test for inherited member functions? The following does not work in VC8 and GCC4 (i.e. detects that A has a member function foo(), but not that B inherits one): #include <iostream> template<typename T, typename Sig> ...

Cannot export template function

I have a class named "SimObject": namespace simBase { class __declspec(dllexport) SimObject: public SimSomething { public: template <class T> void updateParamValue( const std::string& name, T val ); } } I have another class named "ITerrainDrawable": namespace simTerrain { class __decls...

Allowing users to script inline, what inline scripting engines are there for either .net or java?

Are there any open source scripting engines that allow you to give your users the ability to perform light scripting on pages via a web based interface? (some objects/collections would be pre-populated, and have security in place so users can't hack into the web application's inner workings etc.) Examples: http://wiki.shopify.com/Usin...

Download page template for Wordpress

I'm using Wordpress primarily to host some downloads (icons, to be exact) and I'm wondering if anyone's ever come across a page template for exactly that. Ideally I'd like a grid page where I can easily add and remove downloads to programatically (if possible). I'd like to use jQuery for the visuals. A Google query of "download page tem...

WPF DataTemplate Binding BUG: AmbiguousMatchException

Hello! Here are the DataTemplates: <DataTemplate DataType="{x:Type data:Item}" x:Key="ItemTemplate"> <Border/> </DataTemplate> <DataTemplate DataType="{x:Type data:StyleItem}" x:Key="StyleItemTemplate"> <Border> <ContentControl Content="{Binding Item}" ContentTemplate="{StaticResource ItemTemplate}"/> ...