I want to use a variable provided from my CMS to reference an include template like this:
extends layout
include layouts/#{data[0].fields.layout}.pug
This just looks for layouts/#{data[0].fields.layout}.pug rather than what I wan, e.g. main.pug. Is there a way to do this?
Unfortunately, this is not possible at the moment. Dynamic includes are currently not supported by Pug (see this SO answer and this Github issue).
Related
I just tried to use the switch tag on a twig template, on a Symfony 5 project and got an error.
Then looked for a solution on the web, found documentation, double checked my syntax, that was correct.
Finally, searched the twig vendor folders and didnt' found any switch*.php file.
I guess this is not available by default but can't believe it. Does anyone have an idea?
No, swicth not exists in default Twig installation.
To use the switch statement you must implement it by yourself or use a bundle/package like buzzingpixel/twig-switch.
I am trying to apply mvc pattern (as in ruby) using node.js. I would like also to use a common layout and partials. I saw this post and I tried Locomotivejs, but I don't know how to apply a common layout and partials with Locomotivejs. Should I use another frameworks? if I should, which one has all these features? Could you please give me some suggestion?
You can see what I did in order to solve that problem with locomotive.js here:
The discussion forum module for expression engine uses {include:file} tags in its templates like in forum_themes/developer/forum_index/main_forum_list.html:
{include:table_heading}
{include:table_rows}
{include:table_footer}
I've searched for the include tag documentation but I can't find it anywhere? What is the include tag and when/where should it be used? Is it specific to the discussion forum module?
I cannot speak to the scope of the {include:file} tag but for most purposes the {embed} tag is what you will be using in ExpressionEngine to include/embed other bits of code.
Other alternatives, depending on the information you would like to include in your page, are the Snippets, Global Variables, or for more complex information LowVariables
Forums are quite difficult to customize and there is very little documentation but the include for forums essentially acts as an embed.
For customizing your forums I would recommend looking at using at the Scaffold Theme on Devot:ee
It should also be noted that {include:file} only work in the forum template code and most standard EE tags (such as the {embed} tag) don't work in the forum templates. Why? I don't know, but dems da rules. :)
There is no documentation on the {include:XXX} tag as it is only used in the Forum templates.
You will never use this tag in normal EE templates. In EE templates you will use an {embed="group/template"} tag or a Snippet depending on your needs.
In addition to embedding templates within each other, you can also create shared layouts for your templates. A layout can be thought of as a wrapping template or a reverse embed. To use a template you use the {layout=""} tag at the top of your template:
{layout="template_group/template"}
I'm using Joomla 1.5 and I'm trying to get the search component in the front-end to reference my custom components, not those just through com_content and com_newsfeeds, etc. A lot of my custom components get data from MySQL so it would help even more if I were able to add the tables for com_search to go through as well (in addition to referencing the actual file for the component itself, where the static HTML surrounding the PHP tags are written). Has anybody tried doing this?
Looks like you need to create search plugin, which will do search through your own component. Check this:
http://docs.joomla.org/Creating_a_search_plugin
Also, would be helpfull to look on default joomla search plugins. They are stored there
\plugins\search\
I hope it will be helpfull.
Is there any way to enforce a template in Bugzilla to guide users fill in bugs descriptions ?
Actually, i'd like to put some markup texts in the bug description field and avoid the creation of custom fields.
I've installed version 3.2rc1.
Indeed, just check ../enter_bug.cgi?format=guided , which forms an example of the template feature. Half the work is already done for you.
The mechansism described under 6.2.5 Particular Templates (under the section called bug/create/create.html.tmpl and bug/create/comment.txt.tmpl) works pretty well for us. Even though you say you don't want to create custom fields, adding some arbitrary HTML is easy enough.