templates

Smart-like template engine for java?

Is there any template engine (open source) that is like Smart? I want to make it easy for users to design their templates in HTML and then use it, which the smarty-template really is good for. JTPL is close to my example of what I'm looking for, but I want the "foreach" part in the template to be able to let users customize the result pa...

c++ templates error

#include <iostream> #include <cstring> #include <string> template <typename T> inline T const& max (T const& a, T const& b) { return a < b ? b : a; } inline char const* max (char const* a, char const* b) { return std::strcmp(a,b) < 0 ? b : a; } template <typename T> inline T const& max (T const& a, T const& b, T const& ...

Web-dev/design template implementation and creation?

I've been trying out loads of different way to make the most effecient "template" for a site. The site consists of 'Sections', 'Menus' and 'SubMenus'. So to the question; what would be the most efficient and "slick" way of making a "template" for it? I've tried including headers and footers (Making all "head" items in the "header.php" an...

Has anyone been able or at least tried to port Liquid Template Language to C#?

I need to give end-users the ability to securely edit an asp.net mvc web application templates and so far Liquid Template Language seems to be perfect, but it is written in Ruby and porting it seems a too complex task for me as I don't know Ruby... anyone tried to port it to C#? It would be really useful in a lot of situations and I'm go...

Tips for template systems

hi, i am wondering how i can create functional template system, something like smarty. I dont want to use ready made template systems because they slow down page. I want to create template system where i can add in certain pages a new JS code or new stylesheet or even remove the sidebar. I think i could get that result by using output b...

<template> replacement for C linkedList

Hi All Just finished small linked list in C, and realized that I got a problem :) There is no template arguments for C, so at the start of the file I declaring my data type for list, something like: typedef int LData; So far so good, but I cant use this Linked list for 2(or more) different data types in one program. I can define LDa...

HTML Comments to detect IE6 and IE7

<!--[if IE 6]> I am using IE6 <![endif]--> That works. How do I do "or" IE7? ...

How to generate XML file using Ruby and Builder::XMLMarkup templates?

As you all know, with Rails it is possible to use Builder::XMLMarkup templates to provide an http reponse in XML format instead of HTML (with the respond_to command). My problem is that I would like to use the Builder::XMLMarkup templating system not with Rails but with Ruby only (i.e. a standalone program that generates/outputs an XML f...

C++ templates problem

I am new to templates in c++. i was trying some small programs. CPP [80]> cat 000001.cpp 000001.hpp #include <iostream> #include <string> #include "000001.hpp" int main() { int i = 42; std::cout << "max(7,i): " << ::max(7,i) << std::endl; double f1 = 3.4; double f2 = -6.7; std::cout << "max(f1,f2): " << ::max...

Django templates - can I set a variable to be used in a parent template?

I have a parent template that contains a generic navigation menu. I want to be able to add class="selected" to the appropriate menu option. I want to be able to set a variable in a child template, for example: {% set menu = "products" %} and do: {%ifequal menu "products" %}class="selected"{% endifequal %} I don't want to set a val...

I need to know how to create a custom webform template in ASP.NET that allows me to pick a master page

Using Visual Studio 2008, I need to create a custom web form that when picked acts like the web content form, by providing a dialog that lets you pick a master page. I have looked through the webform.zip template and thought I had a clue, but trying different combinations has baffled me as it either doesn't appear or doesn't work. Also ...

Where/how to define a template

What is the best pratice in regards to defining a template in C++? template <class T> class A { private: // stuff public: T DoMagic() { //method body } } Or: template <class T> class A { private: // stuff public: T DoMagic(); } template <class T> A::T DoMagic() { // magic } Another way? I seem t...

Editing a WSS 2.0 template

I have an STP file that is used to create WSS 2.0 sites. I have been asked to add an additional folder to the existing structure that is in the template. How can I edit this STP to make this change? ...

Passing in member variables of a specified class.

I want to pass in the name of a member variable. I thought I could do this by template <typename T::*> void SetVal(T::* newval) { }; This obviously doesn't work, but hopefully gets across what I'm trying to do. I want to be able to set a certain member variable of the templated class. ...

Lightweight PHP5 based template class/system

Hi there. Looking at using a template system for a new project, it's only a small site and don't want to use the overhead and 'complexity' of smarty. I don't really like template systems that force you to make use of another language just to make it easier for designers (apparently). Something like this http://www.namepros.com/code/...

How do I display 2 views in 1 activity (android)?

Suppose I have a webview open: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); main_webv = (WebView) findViewById(R.id.mainwebview); main_webv.setWebViewClient(new HelloWebViewClient()); main_webv.getSettings().setJavaScriptEnabled(true); main...

How do I specialize a templated class for data type classification?

We use boost - so using that library should be fine. But I've never managed to wrap my head around creating a set of templates which give you the right specialization for a whole class of data types, as opposed to specializing for a single data type (which I know how to do). Let me go for an example to try to bring this down to earth. ...

C++ templated typedef

I have a templated class template <T> class Example { ... }; inside which there are many methods of the following type: template <class U> <class V> method(....) Inside these I use tr1::shared_ptr to U or V or T. Its tedious typing tr1::shared_ptr<const U> or tr1::shared_ptr<const V>. The obvious thing to do: template <typenam...

Selecting xcode project template

Hi I am new to iphone development. I have to develop an iphone application which is basically a questionare. When user runs the application he has to answer around 30 questions, each one at a time. I am planning to use the Navigation template project for this application. Where i can create a view with question and optional answers (in ...

How can I make Joomla 1.5 menus?

I'm making my own Joomla template, but when I check menu manager, it seems to be very confusing, because there are a lot of choices. I just need simple menu linking to my sites pages. So I need to know: 1) What kind of tag I need to insert to my template, so that it can show menus. 2) How can I link to pages on my site with that menu ma...