Forums / General / Custom tags in Online Editor

Custom tags in Online Editor

Author Message

Andrew Kelly

Tuesday 22 November 2005 12:48:28 am

Hi all,

I'm having what appears to be a known issue regarding custom tags in the OE. Or, more accurately, I'm faced with a situation that many see as an "issue" and many see as logical design. Whatever it actually is, I haven't yet found a clear answer anywhere as to how to approach it.

Regarding custom tags in the OE (whether default or added by me) there is a layer of granual control that seems to be missing. The problem is that no matter how detailed the template is, {$content} is deliverd wrapped in paragraph tags (as apparent standard behavior when dealing with XML blocks).

There are, of course, many instances where a paragraph wrapper completely defeats the design, and I am after any way to control that.

If there was a way to strip the outtermost paragraph tags from {$content}, that would be perfect.
Or, if it were possible to assign a class to that paragraph block, that would be brilliant as well.

Is there anyway at all to do either of these things?

Help very much appreciated, and my great thanks in advance.
Andy

Kirill Subbotin

Thursday 24 November 2005 1:04:56 am

Yes, its a general ez publish problem - everything is wrapped in paragraphs in ezxml, this paragraphs get to the output and you can't control this process.

Although I can propose to fix this on the output level, for example to implement a setting that will strip off inner paragraphs. It could be an array with tag names as index and true/false values.

Nathan Kelly

Friday 25 November 2005 5:41:54 am

Hi Andrew, I'm not 100% clear on your needs but I know that the extra markup can be a pain, in some cases I have used the strip_tags function to get around this issue on the output as Kirill mentioned, however I'm not sure if it will help you with custom tags?

If you haven't already, you can set up the strip_tags function (from PHP) in template.ini.

[PHP]
PHPOperatorList[]
PHPOperatorList[striptags]=strip_tags

Then in you output template code use something like:

{$node.data_map.body.content.output.output_text|wash|striptags}

I'm not sure if this helps, I know it may not be a clean solution but it might get you out of trouble?

Cheers!

Pardon me while I burst into flames...

Andrew Kelly

Friday 02 December 2005 2:24:35 am

Thank you both for your answers, and please forgive the tardy response. I was assuming I'd get mail when a response was posted and didn't.

At any rate, because I'm under a heavy deadline, I just wrapped the output in a <div> container of a certain class, and then redifined paragraphs within to have no margins or padding.

Cheap hack, but got the job done, and at the moment that's the only priority.

I'll investigate your suggestions in the new year when I have a bit of breathing room.

Thanks again, both of you.

Andy