Forums / Developer / Is any way to enable tags <p>, <font>, <span> in articles?

Is any way to enable tags <p>, <font>, <span> in articles?

Author Message

Vytautas Germanavičius

Tuesday 21 September 2004 1:02:31 am

I've read http://ez.no/ez_publish/documentation/customization/components/datatypes/ezxmltext/custom_tags
and http://ez.no/ez_publish/documentation/customization/components/datatypes/ezxmltext/tags
, but didn't find solution. Maybe i missed something?

Problem is that I need to put huge number of HTML documents generated by OppenOffice, which is using P, SPAN, FONT Tags for formating text.

Of course i can write replace script to convert it to custom tags, but i think it's not user friendly way.

More, why should users learn custom tags instead of HTML?

{set-block scope=root variable=cache_ttl}0{/set-block}

Paul Forsyth

Tuesday 21 September 2004 1:03:48 am

Use the literal tag. You can then put html inside it.

paul

Vytautas Germanavičius

Tuesday 21 September 2004 1:22:47 am

Thank you, this is solution for the moment, but...Is any other way to do this?
Because i have to teach users, who is using OpenOffice for editing HTML, to write something additional to text area.
I would like to minimise work for users. Can be this done automaticaly? I don' understand, why i cannot define, which tage i would like to enable?

In general (not in my case) such usage of literal tag is a hack, because it allows to use meta tags and javascripts...

{set-block scope=root variable=cache_ttl}0{/set-block}

Paul Forsyth

Tuesday 21 September 2004 2:06:25 am

Well, you could replace the xml text field with a regular text field. This allows anything to be entered.

paul

Vytautas Germanavičius

Tuesday 21 September 2004 2:12:47 am

Thank you for quick answer.
Should I edit Article class or just templates for admin site?
What will happen with already entered articles, if i change Article class?

{set-block scope=root variable=cache_ttl}0{/set-block}

Paul Forsyth

Tuesday 21 September 2004 2:17:17 am

This should be done in the class. If you already have other articles then you could lose data because you would need to delete the previous xml field.

If you have articles maybe you should create a second article class, which is a copy of the first but with text fields instead of xml text fields.

paul

Vytautas Germanavičius

Thursday 07 October 2004 12:54:42 am

I created new class from Article class. I changed "XML Text field" to "Text field" as you offered...
But i got as result: all < and > was converted to &lt; and &gt;
It's not possible to add HTML at all.

This is not what i asked.

{set-block scope=root variable=cache_ttl}0{/set-block}

Paul Forsyth

Friday 08 October 2004 12:41:29 am

Text fields dont process those tags so you must have done something wrong. Have you made sure your objects are using the new text fields?

paul

Gunnstein Lye

Monday 11 October 2004 2:55:00 am

vytis,

Check your template for the text area data type. If it contains the wash() operator, then that is why html is converted. Remove it and it should work.

Vytautas Germanavičius

Monday 11 October 2004 3:40:21 am

Ok, it seems you found solution :)
i cheked template /content/datatype/view/eztext.tpl and found
{$attribute.content|wash(xhtml)}
As i undertand, i sould override this template. Question is on which site I should do this: on admin site, or users' site?

I think, it would be useful to have explanation in documentation, how to make able to enter HTML.

{set-block scope=root variable=cache_ttl}0{/set-block}

Marko Žmak

Thursday 14 October 2004 9:38:04 am

You should probably do it on the users site, sinc the wash probbly occurs when displaying data, but I'm not 100% sure. If someone else could confirm please.

At least try overridnig it at user site, and see what you get.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Peter R.

Sunday 04 September 2005 1:18:41 pm

I'm beginner. Please, can you give me links to reference or simply tell me, <b>how and where</b> I can replace XML Edit with HTML Edit? I want those <i>evil</i> (X)HTML tags to show normally.

I don't understand talking about classes. Please, tell me which files I need to edit and what I need to change within them.

I beg you for answer, I've been searching for it (forum, docs, files) for seven hours. Usually I try to figure out what is going on in project by myself (FAQs, DOCs, MANs). This is too difficult for me to understand.

Sorry for my bad english, hope it's clear enough to understand message.

Peter R.

Monday 05 September 2005 8:41:48 am

Please, can you give me just link to proper documentation page. I'll be able to do changes myself, but I don't know where begin to look. Which files I should be interested with? I'm desperate, deadline is coming really fast. :(

Vytautas Germanavičius

Monday 05 September 2005 9:56:18 am

I solved this problem in such way:
1. i overrided template for tag <literal>. usualy it adds <pre>content</pre>. I removed <pre> tag.
2. an whwen i need to use simple HTML, i write <literal>, then HTML code, then </literal>. Then EZ prints exactly what i writes to article.

{set-block scope=root variable=cache_ttl}0{/set-block}

Nathan Kelly

Thursday 08 September 2005 1:42:45 am

I'm interested in the idea of being able to write plain XHTML into an article/page etc. and I can see that overriding the <literal> tag will work but what if I need to write code into a page with <pre> tags as the <literal> tag currently does?

Would I then need to create a custom tag that uses <pre> tags?

I tried creating a custom tag that would allow plain XHTML but it seems that if you write a <div> tag inside that custom tag, ez will still reject it, but not if you place it inside a <literal> tag.

How could I make a <literal> tag for <pre> text and another for plain XHTML? I could override it but how do you override an element within the XMLblock without affecting all <literal> tags, I mean how would you identify it specificaly?

Sorry for all the questions...

Cheers!

Pardon me while I burst into flames...

Vytautas Germanavičius

Friday 09 September 2005 3:01:00 am

If i realy need to get < pre > tag in web page, i write:

<literal>
<pre>
blah..bla 
</pre>
</literal>

But I offer to avoid < pre > tag, usualy i use CSS formating...

{set-block scope=root variable=cache_ttl}0{/set-block}

Nathan Kelly

Friday 09 September 2005 5:03:47 pm

I actually tried adding <pre> tags inside <literal> tags and my source code outputs...

<literal>
<pre>
<ul>
<li>for example</li>
</ul>
</pre>
</literal>

Correctly but for some reason the browser wont render it correctly, all I see is the text within the <li> tags rendered as preformatted text but none of the tags appear?

Very strange behaviour, but I tend to agree with the idea of using CSS as you said, so its really no big deal just thoughts really.

Cheers!

Pardon me while I burst into flames...