templating

Tridion: Template Builder and Visual studio debugging

帅比萌擦擦* 提交于 2019-12-05 09:46:51
We are creating compound templates using Visual Studio 2008. While debugging, we attach to the process of template builder. However we are not able to locate the template builder process ID while attaching the process in VS 2008. This works well on our dev server where VS 2008, CMS(Tridion 2011 SP1) and Template builder are on the same server. But doesn't works if the VS2008 and Template Builder are installed on a machine other than CMS server. Is it a pre-requisite to have all (VS2008, Template builder and CMS) on same server especially for debugging? Bart Koopman When you are on the local

Jade - Controlling line-breaks in the HTML output

大城市里の小女人 提交于 2019-12-05 03:19:11
I have a simple search form I wish to implement using Jade. form input( type="text" size="16" placeholder="Enter your keywords") input( type="button" value="Search") The output is rendered as: <form> <input type="text" size="16" placeholder="Enter your keywords"> <input type="button" value="Search"> </form> This is perfect except that the line-break is causing a space between my button and the search button. I need no space between the textbox and the button. I need the code to render like this: <form> <input type="text" size="16" placeholder="Enter your keywords"><input type="button" value=

Rendering templates within helpers in handlebars

混江龙づ霸主 提交于 2019-12-04 19:34:40
问题 Hey guys! Because there seem to be no answer on this: Passing variables through handlebars partial yet, I'm currently working on a little workaround to get this work. So, the idea is to register a helper function which renders a specific template with possible values. A bit code makes it better to understand. This is how a I'd invoke my helper: <div> {{myHelper}} </div> This helper is registered with this little code: hbs.registerHelper(name, function (args) { args = args || {}; var template

HTML Templates — php?

雨燕双飞 提交于 2019-12-04 19:26:56
问题 So, I'm making a site about WWI as a school assignment, and I want this to appear in every document: <!DOCTYPE html> <html> <head> <title>1914</title> <script src="modernizr-1.5.js"></script> <link href="styles.css" type="text/css" rel="stylesheet" /> <meta charset="utf-8" /> </head> <body> <div id="container"> <header> <img src="images/banner.png" alt="World War I" style="border: none"/> <nav> <ul> <a href="index.htm"><li><span>Home</span></li></a> <a href="1914.htm"><li><span>1914</span><

Convert Jade to EJS

旧时模样 提交于 2019-12-04 17:21:12
Can anyone please help by convert this Jade to EJS? extends layout block content h1. User List ul each user, i in userlist li a(href="mailto:#{user.email}")= user.username There is no block but an include logic available in EJS. Split up the "main layout" that way that you can include a header and footer (or whatever suits your needs). The iteration is expressed in plain JavaScript escaped in sequences of <% ... %> . Using <%= ... %> directly outputs the referenced var. Your resulting EJS code might look as follows: <h1>User List</h1> <ul> <% for (var i = 0; i < user.length; i++) { %> <li><a

render_to_string in lib class not working

你。 提交于 2019-12-04 10:07:44
问题 I'm trying to use delayed_job to update a remote database via xml In my lib folder I put a file with a class that should do a render_to_text with template.xml.builder , but I get: undefined method `render_to_string' for #<SyncJob:0x7faf4e6c0480>... What am I doing wrong? 回答1: ac = ActionController::Base.new() ac.render_to_string(:partial => '/path/to/your/template', :locals => {:varable => somevarable}) 回答2: I had problems with a undefined helper method then I used ApplicationController

How do I render partials with jade without express.js?

 ̄綄美尐妖づ 提交于 2019-12-04 03:19:11
Only info I found was this: http://forrst.com/posts/Node_js_Jade_Import_Jade_File-CZW I replicated the suggested folder structure (views/partials) But it didn't work, as soon as I put !=partial('header', {}) !=partial('menu', {}) into index.jade, I get a blank screen, the error message I receive from jade is: ReferenceError: ./views/index.jade:3 1. 'p index' 2. '' 3. '!=partial(\'header', {})' partial is not defined I'd be very grateful for any help ! (I strongly prefer not to use express.js) I think partial rendering is done in express, so you will have to snag that code or write your own. I

How do I use a template code generator (eg freemarker) in Maven?

一笑奈何 提交于 2019-12-04 00:11:20
How would you structure Freemarker (or an alternative) as a templating code generator into a Maven project? I'm pretty new to Maven and would appreciate some help. I want to generate some code from templates in my project. [a] Rather than write my own, googling found freemarker which appears to be used by Spring which is a good enough reference for me, though as I haven't started with it yet, any other suggestions that work well with Maven would be appreciated too. This website tells me how to add it as a dependency to my pom.xml. This SO question tells me where the generated sources should go

Meaning of Dollar Sign & Curly Braces Containing Javascript Block Outside of HTML Script Tag

◇◆丶佛笑我妖孽 提交于 2019-12-03 15:54:02
I'm currently reading 'Javascript Web Applications' (O'Reilly, Alex MacCaw) and very early on there's a code snippet which might appear to execute a JS function, within an HTML document, yet it is not enclosed by <script> tags: // template.html <div> <script> function doSomething(aParam) { /* do stuff ... */ }; </script> ${ doSomething(this.someX) } </div> Please could someone kindly explain the dollar-sign-curly-brace notation ? I'm currently learning JS and I haven't seen this before, so I'm presuming it's either JS shorthand for code execution (if so, why no terminating semi-colon?), or

Passing an array of objects to a partial - handlebars.js

旧城冷巷雨未停 提交于 2019-12-03 14:49:24
Im trying to pass an array of objects into a partial as an argument: {{> partial [{title: "hello", year: "2015"}, {title: "hello2" year: "2015"}] }} and then on the partial: <div> {{#each this}} <label>{{title}}</label> <label>{{year}}</label> {{/each}} </div> ... but nothing shows up. Is there a way to pass array data to a partial? Thanks in advance. Create a helper that parses the JSON and wrap your partial with this context. Template: {{#getJsonContext '[{"title": "hello", "year": "2015"}, {"title": "hello2" "year": "2015"}]'}} {{> partial this }} {{/getJsonContext}} Note that the names are