The following examples shows how to create a header image using this extension. In case there is no image set in the flexform of the current page, the extension will search in the pages up in the rootline, because the slide parameter is set to 1. You can use this either directly in your Templavoils DS or also import it from some lib.XY TS path.
10 = IMAGE
10.params = class="headerimage"
10.file = GIFBUILDER
10.file {XY = 750,224
format = jpg
10 = IMAGE
10.file.import = uploads/tx_templavoila/
10.file = put path to default image here, just in case ;-)
10.file.import.postUserFunc = tx_tsflexaccess_pi1->main
10.file.import.postUserFunc {slide = 1
fields = field_headerimage
}
10.file.import.listNum = 0
10.file.width = 750
10.file.height = 224
}
You can use the static template provided by the direct mail extension to create the plaintext version of your newsletters if you've built your site with Templavoila. However, I noticed that non-used elements on newsletter pages are still rendered in the plaintext version, which may cause problems for users not knowing about this.
You can use the static template provided by this extension to solve this. It modifies the select statement in the plaintext template. Instead of selecting content elements by colPos it fetches the content elements uids from the flexform and adds an according where statement.
tx_directmail_pi1.10 { marks.CONTENT {select.pidInList >
select.where >
select.andWhere >
select.andWhere.postUserFunc = tx_tsflexaccess_pi1->main
select.andWhere.postUserFunc { fields = {$plugin.tsflexaccess.dmplainflex.fields}allStdWrap.wrap = tt_content.uid IN (|)
}
}
}
If you use this template make sure your import it after the original direct mail plaintext template, because it's only an extension and won't work without it. Alse be sure to set the constant plugin.tsfrexaccess.dmplainflex.fiels to the flexform filelds you want to use in your plaintext newsletter. You can use the constant editor to do this.