texttoimage with transparent background

Author Message

Reinhard Hutter

Thursday 15 January 2009 8:11:06 pm

I need to create texttoimage pictures with transparent backgrounds and have already found this extension that seems to allaw transparent backgrounds as well as background images:

http://issues.ez.no/IssueView.php?Id=12742

However, I failed to correctly install those two files. I tried to put them into the corresponding lib/ez<i>classname</i>/classes directories, but this didn't work. Can someone tell me the correct directories for each one of those files?

TIA
Reinhard

Reinhard Hutter

Wednesday 21 January 2009 5:32:39 am

After a bit trial & error and inspiration by other template extensions, I solved it this way:

1. Inside the extension directory create following directory structure

texttoimage_ext
texttoimage_ext/autoloads
texttoimage_ext/lib
texttoimage_ext/settings

2. Copy the 2 original files from the link in the posting above into the lib directory
3. In "autoloads", create a file "eztemplateautoload.php" with following content

<?php
// Operator autoloading

$eZTemplateOperatorArray = array();

$eZTemplateOperatorArray[] =
  array( 'script' => 'extension/texttoimage_ext/lib/eztemplateimageoperator_ext.php',
         'class' => 'ezTemplateImageOperatorExt',
         'operator_names' => array( 'texttoimageext' ) );

?>

4. In "settings", create a file "site.ini.append.php" with following content

#?ini charset="iso-8859-1"?
# eZ publish configuration file.

[TemplateSettings]
AutoloadPathList[]=extension/texttoimage_ext/autoloads

5. activate the extension and clear the cache

Now you can use the new operator "texttoimageext" in your templates. I don't really have enough experience to code ezPublish extensions, so there might be more elegant ways, but at least it works for me.

Daniele Nocentini

Friday 03 April 2009 2:31:59 am

Thanks for your tips!

Antica Bottega Digitale srl
http://www.abd.it

Andreas Kaiser

Thursday 16 April 2009 7:17:34 am

Also in case of using special fonts in headings or short text fragments you can use "sIFR" as an alternative (best reason of using sifr is the search engine optimization and accesibility):

http://en.wikipedia.org/wiki/Scalable_Inman_Flash_Replacement

eZ Partner in Madrid (Spain)
Web: http://www.atela.net/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 10:21:57
Script start
Timing: Jan 18 2025 10:21:57
Module start 'layout'
Timing: Jan 18 2025 10:21:57
Module start 'content'
Timing: Jan 18 2025 10:21:57
Module end 'content'
Timing: Jan 18 2025 10:21:57
Script end

Main resources:

Total runtime0.7811 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 588.0078152.6250
Module start 'layout' 0.00610.0030 740.632839.4453
Module start 'content' 0.00920.7702 780.0781591.9141
Module end 'content' 0.77940.0016 1,371.992212.1563
Script end 0.7810  1,384.1484 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4559160.0002
Check MTime0.00150.1907160.0001
Mysql Total
Database connection0.00110.146110.0011
Mysqli_queries0.725192.8391620.0117
Looping result0.00060.0805600.0000
Template Total0.743495.220.3717
Template load0.00200.251920.0010
Template processing0.741494.922620.3707
Template load and register function0.00010.016110.0001
states
state_id_array0.00090.120710.0009
state_identifier_array0.00110.140520.0005
Override
Cache load0.00150.1940260.0001
Sytem overhead
Fetch class attribute can translate value0.00140.176030.0005
Fetch class attribute name0.00120.151260.0002
XML
Image XML parsing0.00110.136930.0004
class_abstraction
Instantiating content class attribute0.00000.001760.0000
General
dbfile0.00230.2890220.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs