Forums / Developer / HTML / Javascript in Articles

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