templates

In browser template editor

I'm tending to make an in browser template editor. It will have a GUI to play with css (text, background, margin...) html (make div layout) and generate html and css separately. But it seem is huge thing to do. So I'm looking for something similar. Any suggestion? ...

How do i render a template inside another template?

Hello, I'm new in Django and Python and I'm stuck! It's complicated to explain but I will give it a try... I have my index.html template with an include tag: {% include 'menu.inc.html' %} The menu is a dynamic (http://code.google.com/p/django-treemenus/). The menu-app holds a view that renders menu.inc.html: from django.http import...

How to create a type-tag for template specialization

I have a custom logging class that supports iostream-syntax via a templated operator <<: template< class T > MyLoggingClass & operator <<(MyLoggingClass &, const T &) { // do stuff } I also have a specialized version of this operator that is supposed to be called when a log-message is complete: template< > MyLoggingClass & operat...

encode url not encoding

Hi all. I am working in a template in Moveable Type and would like to do the following: <a href="http://twitter.com/share?url=&lt;$mt:EntryPermalink encode_url="1" $>">Twitter</a> It all works but I'm worried that the current link or at some point even if I use a title mt tag that it might not be right for the browser address bar. I ...

Django: using intcomma with floatformat

Found out about using intcomma with floatformat here, but have not been able to get it working. Here's what I've done: 1) Add django.contrib.humanize to installed apps 2) Add {% load humanize %} to top of template 3) Using {{ feeditem.distance|floatformat(0)|intcomma }} in the code Interestingly, floatformat:0 and floatformat:"0" did...

C++ template member variable in templatized class has incomplete type

I have code similar to the following in a header file: template<class A> class List { private: QVector<A> _list; }; where QVector is the standard QT container. When I try to make a variable of type List as a member variable in another header file like this: class Model { private: List<int *> the_list; }; I get the fo...

Line break weirdness in PHP templating

I've been dealing with this for years but it's so nit-picky that I never looked into it. But I have always wondered. In a PHP template, if I run this: <p> <?php echo 'Between "?>" and "</p>" is one linebreak.'; ?> </p> <p> <?php echo 'Between "?>" and "</p>" is one space, then one linebreak.'; ?> </p> <p> <?php echo 'Between "?>" an...

how to load velocity template dynamically through properties file

I am using velocity templates as view component,and my welcome file is also a .vm file.Here I am facing the problem,when ever I run my application that .vm file is not rendered by the velocity engine.So to render that .vm files at the time of loading application what to do? ...

Inherit from specialized templated base class and call the right method

I.e. I got 2 specialized types of: template <class Type, class Base> struct Instruction {}; to compile-time-select the appropriate type from within a type list. like: template <class Base> struct Instruction<Int2Type<Add_Type>, Base > { void add() {} }; template <class Base> struct Instruction<Int2Type<Mul_Type>, Base > : ...

symfony - clean variables before sending to template

Hi! On the project I am currently working, I had created an action that generates a csv file. Here is some of my current template codem, which generated the csv file on-the-fly: <?php header('Content-Disposition: attachment; filename="file_'.date("Y-m-d_H-i",time()) .'.csv"'); ?> Branch:;<?php echo $branch; ?>; The variable $branch,...

Passing type of template function to template class used within it?

I am trying to build a template function. Inside templated classes are used and I would like to pass the template type of the function to those classes. So I have: template <class T> T find_bottleneck (ListGraph &g, CrossRefMap<ListGraph, Edge, T> &weight, Node &s, Node &t) { // Check if theres a single edge left if (countEdge...

Visual Studio 2005 Add-in Project Template

I am trying to find a way to develop my own Add-in in C# for Visual Studio 2005 at home, but I don't have the template that comes in the full version of the VS2005. If I get the template, can I compile it on the Express edition? Does anyone have it? Where can I find it? ...

Creating several customized button template

I am just wondering if I can make several button templates in WPF then assign to a specific button the template to be used by 'declaring' the button template name (or other method you suggest) The button templates I am trying to create are: Button with black background, rounded corners, text display Button with silver background, roun...

How to adjust Visual Studio Toolbox to active document?

I have implemented a set of ASP.NET web custom controls and added these to my Visual Studio 2008 Toolbox. I also created some user item templates, which are basically ASP.Net Webforms pages with some preconfigurations. I would now like to assign each item template a subset of my custom controls that shall be available in the toolbox whi...

How to show thumbnails of simple products in configurable products with Magento

I want to show each simple product's thumbnail image and option name with a radio button to select in configurable products. Default behavior is showing options in text with a widget like dropdown box. I am using Magento Community Edition 1.4.1. Are there anybody has done this before? Could you guide me for a right direction? ...

template paradigm and explicit warning

Hello guys, I was trying to compile a short example program ( 134 lines ) making extensive use of templates, and got nothing less than 500 lines of mysterious code really deep inside the template library, which is quite annoying and useless. My point isn't how to solve this issue (most probably add the appropriate path to the project.....

Java HTML Builder (anti-template) library?

I'm always looking for a modern Java library that makes creating valid (X)HTML snippets easy. Yes you could use a templating language but there are times when you do not want to do this because Java has some advantages over insert your favorite templating language. I have seen lots of in-house HTML builders in many projects but there i...

[c++] Type erasure and accessors

Hi, I used type erasure pattern in C++, i.e I hide a template class with an abstract class class Base{ virtual ~Base(){} //pure virtual methods... }; template<typename T> class Derived : Base{ Derived<T>(){} ~Derived(){} //public methods... private : vector<T> datas; }; problem : if I want to retrieve or modify datas, I have...

HTML Templates in Javascript? Without coding in the page?

I am a web guy doing mostly Perl server-side stuff, and I'm slowly coming to a few conclusions. It is far better to do most of your code via Javascript and toss data back and forth via AJAX than it is to hit submit and reload a mostly-identical page I like jQuery because I like CSS, and it's fun to chain together big long and scary-to...

Template specialization: non-inline function definition issue.

The following code compiles properly. #include <string> template <typename T, typename U> class Container { private: T value1; U value2; public: Container(){} void doSomething(T val1, U val2); }; template<typename T, typename U> void Container<typename T, typename U>::doSomething(T val1, U val2) { ; // Some impleme...