templating

how to use Smarty better with PHP?

I found that using Smarty with PHP, sometimes extra time will need to be used for 1) using quite different syntax than PHP itself 2) need to check small cases, because documentation doesn't give finer details, such as for "escape" http://www.smarty.net/manual/en/language.modifier.escape.php it doesn't say escape:"quotes" is for double...

WPF switch template between view mode and edit mode

If have a WPF datagrid on the left of a Window with an area to the right for displaying the selected record. The selected record consists of Textboxes and ComboBoxes that are disabled until the edit button is clicked. All works as expected. However, it seems a bit clumsy to be populating ComboBoxes when the SelectedItem of the DataGrid ...

Change font size of a GridView's ColumnHeader

Is there an easy way to change header font size without overwriting completely duplicating ColumnHeaderTemplate? Note: Not sure if it is relevant, but I use an application theme (PresentationFramework.Royale) which provides the ColumnHeaderTemplate. ...

PHP Templating Looping Results

Hey! So here at work we have a home grown templating system, that is light weight and works great for us so far. The wall we're hitting is that we want to be able to loop over a template. The use case is something like search results. We are trying to think of ways that we could do this. We've come up with three ways right now. F...

Which Java templating system should I use to generate emails?

I have a website that uses JSP as its view technology (and Spring MVC underneath). Unfortunately, JSP is just a pain to use for anything that doesn't involve an HTTP session. I would like to be able to occasionally send my users some email, and I want to use something JSP-like to render the email's contents. Technologies I'm aware of ...

Two concepts from XSLT in other languages: apply-templates and xpath

Background: Having given up on the practical daily use of XSLT as a part of my programming toolkit, I was wondering if there were any implementations in other languages of the (only) two things I miss about that tool: the ability to traverse data structures using "path" style statments via xpath the ability to traverse template transfo...

StaticResource in Silverlight ControlTemplate?

I'm trying to use a StaticResource in a ControlTemplate for a custom object, and whenever that object is rendered, the application crashes. As you can see in the code below, I define both the template and the resource in App.XAML. I've been doing a bit of searching to see if/why this isn't allowed, but have had no luck so far. <Colo...

using a loop in a template

I started writing my own small scaled framework and i have gotten to the templating part of it. So far i have been able to do simple variable replacing with the following code: public function view($page, $vars) { if(!file_exists('system/views/' . $page . '.php')) { trigger_error("No Template found", E_USER_ERROR); }...

Function for phptemplate matching with matching files and locations

I am trying to run preg_replace_callback, or an ob_start(), extract() combination through a subdirectory. Something along the lines of these functions <?php /** * Execute a PHP template file and return the result as a string. */ function apply_template($tpl_file, $vars = array(), $include_globals = true) { extract($vars); if ($i...

Regex: faulty syntax used with preg_replace_callback?

I have borrowed code from this link http://stackoverflow.com/questions/959017/php-regex-templating-find-all-occurrences-of-var to implement a means of applying values to template fiies. This uses the preg_replace_callback() function my preferred method of naming is name1.name2.name3=value, rather than name1_name2_name3=value, but the re...

How do I set a Data Mapper object to be accessed in view with Ocular in CodeIgniter?

Previously using Ocular 0.25 I was able to set an object as a view data, that I could access in the view: like: $b= new book(); $b->get_where("id",5); $this->ocular->set_view_data("b", $b); //could be accessed in view as $b but in the new Ocular 1.0.1, when I try to set a data mapper object it gives me a blank screen, without an...

django generic templates

So, Generic views are pretty cool, but what I'm interested in is something that's a generic template. so for example, I can give it an object and it'll just tostring it for me. or if I give it a list, it'll just iterate over the objects and tostring them as a ul (or tr, or whatever else it deems necessary). for most uses you wouldn't ...

Styling GridSplitter wpf C#

i want to style my GridSplitter like adding dots on it (as found on http://msdn.microsoft.com/en-us/library/aa970265.aspx). i also want to change gridsplitter color on mouseOver, or apply Aero Theme. <Style x:Key="GridSplitterStyle1" TargetType="{x:Type GridSplitter}"> <Setter Property="Background" Value="{DynamicResource {...

How to implement display like smarty in PHP?

$smarty->assign('name',$value); $smarty->display("index.html"); So that it automatically replaces $variables in index.html which saves a lot of echo? ...

Alternatives to Smarty for separating presentation from code in php ?

I'm currently using the Smarty templating system for our production site, but am curious how much of a performance hit I'm taking by using this templating engine. Are there faster alternatives? Is there a way to code so I may not have to use such a templating system? Thank you! ...

WPF templating/styling issue

Given this piece of XAML <DockPanel> <DockPanel.Resources> <Style TargetType="{x:Type GroupBox}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupBox}"> <DockPanel> <Border DockPanel.Dock="Top"> <Border.Resources> ...

inline markup / templating engine for customer facing CMS

There are many hosted CMS applications that provide you with some sort of inline markup/ templating engine that lets you output things into a page. for example, a hosted cms application lets you edit your templates to custome html/css, but they also let you do some basic inline code on the page to do this like inject the article title, ...

using chain.js for complex templates and images?

Hello, I'm researching the possible use of the jquery plugin chain.js over other templating systems such as jTemplate. the site is a large online retailer. We have a category page showing a large list of products, dresses for example. A user can click on a link on a nav bar te refine the results based on attributes such as colour, size...

ChildWindow Modality

By default the ChildWindow Overlay covers (and disables) the entire root visual. I want to cover (and disable) just part of my UI. How can I alter the existing ChildWindow to allow me to specify the Root? Thanks, Mark ...

Good practices for writing HTML in Javascript

I was wondering about this if people have strong opinions about the best way to generate HTML on the fly, especially with Ajax based applications. Do you just create the HTML code using server side scripting and then send it out to the page or perhaps just return a JSON string and let Javascript do the job. In my personal opinion, th...