multi-column template for Cleverreach - html-email

I'm trying to write a multi-column template for Cleverreach. We need a one-column for the main-content and below this a two- or three-column area for products (dynamic content from MyContent-API).
All my tries dosn't work, it's seems only possible to define one-column areas (loop-areas) for placing content-elements in Cleverreachs WYSIWYG-editor.
If I define more than one loop-areas, only the last area is displayed in WYSIWYG-editor, alls others are gone.
Has someone resolved such a problem? Somthing like:
<table><tr><td><!-- #loop# --> <!-- #/loop# --></td>
<td><!-- #loop# --> <!-- #/loop# --></td></tr></table>
(this example will result in, that only the second column is displayed in WYSIWYG-editor.
Kind regard
Johannes

It#s important, that each loop has a unique numerous ID
<table>
<tr>
<td>
<!-- #loop# --> <!-- loop1 -->
some code
<!--#/loop# -->
</td>
<td>
<!-- #loop# --> <!-- loop2 -->
some other code
<!-- #/loop# -->
</td>
</tr>
</table>

Related

angular-datatables stopped working abruptly

I am using angular-datatables 13.0.1 in my angular application. I displayed a table using the following code in my UI. It was working.
Html:
<table datatable class="datatable table table-striped table-condensed h5" [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" bFilter=false>
<tfoot>
<tr>
<td colspan="8">
<div class="center-cont-block">
<mfBootstrapPaginator [rowsOnPageSet]="[50,100,500]"></mfBootstrapPaginator>
</div>
</td>
</tr>
</tfoot>
</table>
.ts file
this.dtOptions = {
pagingType: 'full_numbers',
pageLength: 50
};
dtTrigger: Subject<any> = new Subject<any>();
I used this link http://l-lin.github.io/angular-datatables/#/welcome to learn how to display an angular-datatable.
I haven't changed any of the libraries related to this. Surprisingly when I try to implement the same logic in another screen, nothing works.
Either the table developed before or new table.
Pagination is not displayed or the sorting. It is not applying any of the angular-datatables properties. When I inspect the code, many of the properties are missing few them are:
2. aria-controls

MailChimp custom template problems with drag and drop blocks

I am creating a custom MailChimp template but having issues when using the mc:repeatable element. I have it on a wrapped around a block of code and in the editor when creating a campaign, it works fine, I can spawn a new version of the parent block and move it around in the template, but when I preview, or send the email, the child block that was spawned from the parent sits below it's parent and not where I have placed it following spawning it from the parent block... Something seems to be wrong? (Heavily simplified) Code example below... Anyone any ideas on the fix???
<!-- BLOCK A -->
<div style="width:100%" mc:repeatable="CONTENTBLOCK_A">
<p>This is block A</p>
</div>
<!-- end of BLOCK A -->
<!-- BLOCK B -->
<div style="width:100%" mc:repeatable="CONTENTBLOCK_B">
<p>This is block B</p>
</div>
<!-- end of BLOCK B -->
So, when creating a new campaign, if I duplicate BLOCK A and position the duplicated BLOCK A below BLOCK B - in the preview within the campaign editor it looks fine, but when I click to view it into PREVIEW MODE, or send a PREVIEW EMAIL - the duplicated BLOCK A sits above BLOCK B and below its original spawned parent BLOCK A element...
Any ideas? Are the HTML COMMENTS (e.g. < !-- --> ) The issue perhaps?
Very late, but I was able to find success using this:
<table mc:repeatable="content" mc:variant="variant_1">
<tr>
<td mc:edit="section_1">
Variant 1 Content
</td>
</tr>
</table>
<table mc:repeatable="content" mc:variant="variant_2">
<tr>
<td mc:edit="section_2">
Variant 2 Content
</td>
</tr>
</table>
<table mc:repeatable="content" mc:variant="variant_3">
<tr>
<td mc:edit="section_3">
Variant 3 Content
</td>
</tr>
</table>
More in depth explanation can be found here: Create Editable Content Areas with MailChimp’s Template Language

merge qml tags file, with lex file for presentation?

I have no knowledge to qml, qt, or c++ for that part.
but my problem is that I have this .lex file, which is really only xml, and some files that end With .qml, like this one frontpagetemplate.qml.
The format in here is unknown too me.
<qt title="{book_name}">
<h1>{book_name}</h1>
<br/>
<!-- BEGIN paragraph_tpl -->
<!-- BEGIN paragraph_html_tpl -->
{html}
<!-- END paragraph_html_tpl -->
<!-- BEGIN paragraph_header_tpl -->
<h2>{header}</h2>
<!-- END paragraph_header_tpl -->
<!-- BEGIN paragraph_text_tpl -->
<p>{text}</p>
<!-- END paragraph_text_tpl -->
<!-- BEGIN paragraph_link_tpl -->
<p>{link_name}</p>
<!-- END paragraph_link_tpl -->
<!-- BEGIN paragraph_olist_tpl -->
<ol type="{list_type}">
<!-- BEGIN olist_item_tpl -->
<li>{text}</li>
<!-- END olist_item_tpl -->
</ol>
<!-- END paragraph_olist_tpl -->
<!-- BEGIN paragraph_ulist_tpl -->
<ul type="{list_type}">
<!-- BEGIN ulist_item_tpl -->
<li>{text}</li>
<!-- END ulist_item_tpl -->
</ul>
<!-- END paragraph_ulist_tpl -->
<!-- BEGIN paragraph_table_tpl -->
<table {bgcolor} {width} border="{border}" cellspacing="{cellspacing}" cellpadding="{cellpadding}">
<!-- BEGIN table_tr_tpl -->
<tr {bgcolor}>
<!-- BEGIN tr_th_tpl -->
<th {bgcolor} {width} colspan="{colspan}" rowspan="{rowspan}" align="{align}">{text}</th>
<!-- END tr_th_tpl -->
<!-- BEGIN tr_td_tpl -->
<td {bgcolor} {width} colspan="{colspan}" rowspan="{rowspan}" align="{align}">{text}</td>
<!-- END tr_td_tpl -->
</tr>
<!-- END table_tr_tpl -->
</table>
<!-- END paragraph_table_tpl -->
<!-- BEGIN paragraph_image_tpl -->
<p><img src="{img_src}" /></p>
<!-- END paragraph_image_tpl -->
<!-- END paragraph_tpl -->
<table border>
<tr>
<th align="left">ID</th>
<td>{book_id}</td>
</tr>
<tr>
<th align="left">Created</th>
<td>{created}</td>
</tr>
<tr>
<th align="left">Last modified</th>
<td>{modified}</td>
</tr>
<tr>
<th align="left">Publisher ID</th>
<td>{publisher_id}</td>
</tr>
<tr>
<th align="left">Publisher</th>
<td>{publisher_name}</td>
</tr>
</table><br/>
</qt>
What is this syntax, is there any editor out there?
Can I convert it to html?
I really have problems finding any info on this. all I find about qml, is something that looks like JavaScript variant.
My goal is to merge these files and make a html presentation of the tags and the data in the .lex file, rather than the ugly-looking lexion it is in today.
The file you posted is definitely a variant on html. Hopefully someone else will recognize it right off as whatever kit it is part of. Perhaps it is rich text, perhaps some other format--but replace qt with html and you'll see it marked up in a web browser.
QML is a language that uses JavaScript style syntax for building applications. In my opinion it is a lot of fun to work with. You can download an IDE at:
http://qt-project.org/
My guess is you have a Qt Quick application that you're looking at, I'd venture a guess at Qt4 but I'm new to the toolkit so my knowledge is rather contemporary.

PHPTAL Dynamic Table Generation

I find myself creating various tables for tabular data quite a bit, and would like to create a macro that can dynamically create tables based on a data structure defined in the calling template (not in the PHP code). Here's a simplistic example:
<!-- Define the macro -->
<tal:block metal:define-macro="table">
<table>
<tr tal:repeat="row data">
<td tal:repeat="col row" tal:content="col" />
</tr>
</table>
</tal:block>
<!-- Use the macro -->
<tal:block tal:define="data ???" metal:use-macro="table" />
What I'm looking for is how to define data (an array structure) from within PHPTAL itself. The reason I can't define this as a template variable in PHP (ex. $tpl->data = array(...)) is because the order and layout of the data belongs in the template. So, for example, if I wanted to flip the X and Y axes of the table, I should only have to modify the template, not the PHP code.
Edit:
To give an example, say I have arbitrary template variables foo, bar, and baz. I can use these in the templates like so:
<span tal:content="foo" /><br />
<span tal:content="bar" /><br />
<span tal:content="baz" />
How can I construct these variables into a two-dimensional data structure of rows and columns which I can then feed into a table-generating macro? Something like this (note: this doesn't actually work):
<tal:block tal:define="data [foo, bar; baz]" metal:use-macro="table" />
Where the desired output from the macro would be:
<table>
<tr>
<td>foo</td>
<td>bar</td>
</tr>
<tr>
<td>baz</td>
</tr>
</table>
And later on, if I wanted to swap the positions of foo and bar, I'd only need to modify the template and change the definition of data to data [bar, foo; baz].
You should probably use helper methods, e.g. either php:transpose_table(input_data) or wrap it in a TALES function:
function phptal_tales_transposed($expr, $nothrow) {
return 'transpose_table(' . phptal_tales($expr, $nothrow) . ')';
}
<tal:block tal:define="data transposed:input_data" metal:use-macro="table" />
Transposition or sorting in PHPTAL itself would be unnecessarily complicated (PHPTAL is not XSLT :)
Answer to edit :)
If you want to combine multiple variables into array, then use:
<tal:block tal:define="data php:array(foo, bar, baz)" metal:use-macro="table" />
array_chunk() function may be useful if you want to have certain number of columns.
and if you like custom syntax, then write phptal_tales_… function that translates your […] syntax to PHP code.
For a Generic Table Generation: PHPTAL: Repeat Column headers and values
<table>
<thead>
<tr>
<th tal:repeat="r results/0">${repeat/r/key}</th>
</tr>
</thead>
<tbody>
<tal:block tal:repeat="r results">
<tr>
<td tal:repeat="t r">${t}</td>
</tr>
</tal:block>
</tbody>
</table>

How to Spread formwidgets in doctrine into multiple columns?

I'm using symfony1.4 with doctrine. I'm able to insert/update/delete records using form widgets. But the problem is i have some 75 fields in a single form which i want to spread into two columns.Please tell me a way to implement this please.....
This can be done by rendering each one individually on your template or view... For example, if your form has a widget called name, in your template of partial, you can render it by doing:
//this will render the row as the assigned formater does
<?php echo $form['name']->renderRow()?>
or
//in a table
<tr>
<td>
<!-- will output only the label -->
<?php echo $form['name']->renderLabel()?>
</td>
<td>
<!-- will output only the 'input' -->
<?php echo $form['name']->render()?>
<!-- will output only the error messages -->
<?php echo $form['name']->renderError()?>
</td>
</tr>
If you have any doubt check the Symfony's Forms for Web Designers for more details.