Share » Forums » Developer » ezoe stripping custom tags

ezoe stripping custom tags

ezoe stripping custom tags

Thursday 27 May 2010 2:17:55 pm - 3 replies

Author Message

André R.

Friday 28 May 2010 1:17:46 am

It could be the valid_elements list in ezxmltext_ezoe.tpl, it was missing "type" attribute on img tag. (fixed in trunk rev. 241 & stable/5.1 rev. 242).

Or it could be the parser, given that these images are posted as images to server, this is how the image to custom tag mapping works:

if ( $name === '' && isset( $attributes['type'] ) && $attributes['type'] === 'custom' )
{
    $name = 'custom';
    // strip out style / tinymce related classes and end up with only custom tag name
    $attributes['name'] = self::tagClassNamesCleanup( $attributes['class'] );
}

But, why hacking? You had custom image tag support since 5.0.1 & InlineImageIconPath since 5.1, ref (content.ini):

#[CustomTagSettings]
#AvailableCustomTags[]=pagebreak
#AvailableCustomTags[]=underline
#IsInline[underline]=true
## Displays the custom tag as an image so you cannot create sub content.
## Will use custom image if there is a custom attribute on the tag named 'image_url'
#IsInline[externalimage]=image
## Lets you specify 22x22 icon to use on custom image tag if it doesn't have 'image_url' attribute
#InlineImageIconPath[mashup]=images/tango/image-x-generic22.png#

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Erik Weinmaster

Monday 31 May 2010 11:37:16 am

Well, the answer to the first segment (of why the image tag is being stripped out) is that I made the mistake of naming the image url attribute just 'url'. Thus when the system was looking for 'image_url', it couldn't find it.

Now, one more problem. I also have 'href' and 'target' as custom attributes to image. So if a user clicks on image and fills in at least the href attribute as well. then the following will be returned:

'<a href="' + customImgHref.value + '" target="' + customImgTarget.value + '"><img id="__mce_tmp" type="custom" src="' + imageSrc + '" border="0" /></a>'

instead of the normal img tag:

'<img id="__mce_tmp" type="custom" src="' + imageSrc + '" />'

Whats happening is that the anchor tag and image tag (from the first example) are being stripped out in the input parser. This doesn't happen when the normal input tag is returned (second example). I've checked the vales for customImgHref and customImgTarget and both are being populate. Also, the anchor tag does go through the conversion to 'link' type.

Is there something else I need to put into the valid_elements?

H-Works Agency

Tuesday 05 July 2011 9:56:03 am

A little example for people figthing for documentation about this topic :

This will make available two custom tags named "included" and "not_included" which will be rendered in ezoe with image/icons/included.png...etc

 [CustomTagSettings]
AvailableCustomTags[]=included
AvailableCustomTags[]=not_included
IsInline[included]=image
IsInline[not_included]=image
InlineImageIconPath[included]=images/icons/included.png
InlineImageIconPath[not_included]=images/icons/not_included.png

EZP is Great

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu