HTML / Javascript in Articles

Author Message

Dan C

Monday 31 January 2005 10:07:28 am

Hi,

I've read and followed hints in these posts:
http://ez.no/community/forum/setup_design/how_to_allow_users_add_small_pieces_of_html_in_a_article
and
http://ez.no/community/forum/developer/is_any_way_to_enable_tags_p_font_span_in_articles

I've tried Paul's comments using the <literal> tag inside the article but that doesn't print out html, it prints out &lt; and &gt; so the end user sees the actual HTML and not the *parsed* html.

So now I have an article class with an extra 'text field' that stores my html/javascript. I modified the full/article.tpl file to print out {$node.object.data_map.html_text.content} and it works great.

Only one problem.. I can't make relative links like you would in templates, ie. {"/stylesheets/mystyle.css"|ezdesign}

Does anyone have any suggestions/solutions?

The only other thing I can think of is making a custom template and override for each node id of each article I want extra javascript/html in.

*Edit: Maybe there is an equivalent function to php's eval() for ezpublish template strings? I've tried searching and haven't found anything yet though.

Thanks,

Dan

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 19 2025 06:16:31
Script start
Timing: Jan 19 2025 06:16:31
Module start 'layout'
Timing: Jan 19 2025 06:16:31
Module start 'content'
Timing: Jan 19 2025 06:16:32
Module end 'content'
Timing: Jan 19 2025 06:16:32
Script end

Main resources:

Total runtime0.9451 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.1563152.6250
Module start 'layout' 0.00530.0030 741.781339.4453
Module start 'content' 0.00830.9352 781.2266401.6719
Module end 'content' 0.94340.0016 1,182.89848.1641
Script end 0.9450  1,191.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3501160.0002
Check MTime0.00140.1463160.0001
Mysql Total
Database connection0.00070.078810.0007
Mysqli_queries0.903695.6121460.0196
Looping result0.00040.0472440.0000
Template Total0.913296.620.4566
Template load0.00220.234420.0011
Template processing0.910996.388820.4555
Template load and register function0.00020.024110.0002
states
state_id_array0.00130.134710.0013
state_identifier_array0.00140.150520.0007
Override
Cache load0.00180.1929160.0001
Sytem overhead
Fetch class attribute can translate value0.00070.072810.0007
Fetch class attribute name0.00070.076410.0007
XML
Image XML parsing0.00100.102310.0010
class_abstraction
Instantiating content class attribute0.00000.000510.0000
General
dbfile0.00070.0762100.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 6
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs