templates

django blocktrans and i18n in templates

Hi, looking for a while with i18n problem in django: this work fine : {% trans cat.name %} cat.name will be translated but this doesn't work: {% blocktrans with cat.name|slugify as cat_slug %}{{ cat_slug }}{% endblocktrans %} cat.name is not translated if I change the filter : {% blocktrans with cat.name|capfirst as cat_slug %}{{ cat_...

Problem with iterators for std::list of boost::shared_ptr

Hi, I'm having a problem with the following code: #include <list> #include <boost/shared_ptr.hpp> #include "Protocol/IMessage.hpp" template <typename HeaderType> class Connection { public: typedef IMessage<HeaderType> MessageType; typedef boost::shared_ptr<MessageType> MessagePointer; template <typename Handler>...

C++ Static member initalization (template fun inside)

Hello all, For static member initialization I use a nested helper struct, which works fine for non templated classes. However, if the enclosing class is parameterized by a template, the nested initialization class is not instantiated, if the helper object is not accessed in the main code. For illustration, a simplified example (In my ca...

Solution Templates in VS2010

I have heard it said that, unlike VS2008, VS2010 will support Solution templates in addition to item and project templates. However, the SolutionTemplates directory contains only a "blank.sln", so it's difficult to draw any inferences about what is supposed to go in there. Has anyone seen any documentation about how to create a soluti...

Subsonic : Can’t decide which property to consider the Key? foreign key issue.

Hi I am trying to select count of rows from a table which has foreign keys of two tables. The C# code threw the error mentioned below. So, I added a primary key column to the table (schema as follows) and regenerated the code. But still the same error is coming. Error : Can't decide which property to consider the Key - you can create o...

using ajax 4.0 render list of data into single template

In my project i have called method WCF service which returns a result but now i am using a method which returns a list of result which i want to append to a single template. my callback function look like this: function callbackEvent(_result){ var result=_result; var title = result.Title; var data = result.Data; var...

How to print an integral template argument at compile time in C++

Say I have implemented a template class like this: template <size_t N> class C { void f() { // print out N here? } }; I wish that while the compiler compiles a clause like C<20> c; it would print out a message "class C is templated with N = 20" I've tried with #pragma and static_assert in vain. The pro...

Strings as template arguments?

Can strings be used as template arguments? I tried: template <char *str> struct X { const char *GetString() const { return str; } }; int main() { X<"String"> x; cout<<x.GetString(); } And although I get no complaints about the class definition, the instantiation yeilds 'X' : invalid expression as a templ...

Debug tt templates in VS2008

Is there a way to debug tt files? I have installed SubSonic3 and all the templates do their job except the StoredProcedures.tt. It remains empty after 'Run Custom Tool'. ...

mysql/php - store html templates within the a database

I am wondering the best way to store html templates in a database where I am able to retrieve them and insert variables. Obviously I could store them as php and then 'EVAL' the record.... but I heard it was evil. is there a better way? :) edit: Sorry I wasn't clear... I tried to simplify it by saying html templates... what I really m...

How do I pass a variable into grails template from a Layout file?

So I have a navigation template (/common/_navigation.gsp) that is getting rendered in the Grails projects main Layout file (/layouts/main.gsp). How do I pass some kind of variable/parameter/arg from the individual view files to layout and eventually into the navigation template? I just want the right tab to be highlighted when I'm on a...

Java Templates array of Template Type in Template

I would like to implement a template which contains an array of the template Type. Is there a way to do something similar to what I have outlined in my sample code? The problem is in the line where this.foo is assigned a new array of the template type. class Classname<T> { T[] foo Classname() { this.foo=new T[128]; } } ...

Can I use C++ templates to generate Unicode/ANSI variants of a function, rather than using the preprocessor?

We've got a bunch of legacy code that doesn't support Unicode, so a transitional pattern we use in our code is to move the function to a .inl file, change char to CHAR_TYPE, and then wrap it up like this: #define CHAR_TYPE wchar_t #define STRING_TYPE std::wstring #define MyFunctionName MyFunctionNameW #include "MyFunction.inl" #undef C...

Designing Template for WP & Joomla

Hi, would designing template for WordPress be difficult or for Joomla be difficult ? ...

OSCommerce - Restructuring productlisting table

Hi anyone know how to restrucutre the productlisting in Oscommerce (using STS template) I can style the output fine, however because the table (i.e ) layout is auto created in the back end I can't figure out where to go to alter the row structure to. Surely there must be a way to customise this? Any ideas? ...

Is it possible top opt-out of INamingContainer if it's implemented by a superclass?

The UserControl class inherits from TemplateControl which implements INamingContainer. Since this is "only a marker interface" I was wondering if it's possible to opt-out of the behavior that this interface brings with it. I am developing a templated control based on a user control, and I want the controls inside the template to be acce...

Languages / Libraries / Modules for building a "template builder" web application?

My company builds websites for membership-based associations. We currently use custom DLL's (written in CodeGear Delphi) which interact with a SQL Server database and use a custom HTML-based template language. Basically we build templates in HTML / CSS / Javscript with the dynamic parts being generated by tags in the format <#TAG NAME>. ...

Code behind user control

How would one go about performing controller actions from withing an ASP.net MVC user control? My scenario is that I have a userID and I want to transform it into a name from the database. To do this I've annotated my model with a display type and put a User template in the shared display templates but I'm not sure where I should wri...

Silverlight: Overriding a theme with a custom ItemTemplate

I have a test project I created to get my feet wet with Silverlight 3. In order to get my AutoCompleteBox to display the correct property in the dropdown, I created a custom item template, like so: <navigation:Page.Resources> <DataTemplate x:Key="ItemDataTemplate"> <Grid Height="12"> <TextBlock x:Name="TextBlock"...

How do I make it so that there is no "Ghost" when I drag an image in Firefox?

When you drag an image , there is a semi-transparent ghost image that follow your mouse when you hold it down. Is there some way to apply CSS/JS to remoe this effect on a certain portion? ...