eZ Community » Forums » Setup & design » Adding options to Custom Tags
expandshrink

Adding options to Custom Tags

Adding options to Custom Tags

Wednesday 20 June 2007 7:44:51 am - 6 replies

Is it possible to set attributes to Custom Tags with limited options such as 'left' and 'right', similar to the Alignment in the the Related Objects popup in the Online Editor?

I'm trying to make a Custom Tag to insert Google Maps with more flexibility than the two extensions currently available (sometimes the default zoom level just isn't appropriate, and it'd be nice to be able to specify satellite view for places which have no map data). I'd like to be able to have the tag insert offer three or four sensible zoom options. Even better would be to be able to give them friendly names rather than '12', '15 etc.

Wednesday 20 June 2007 8:18:24 am

Hi Paul,

It is possible:

content.ini.append.php
[factbox]
CustomAttributes[]=align
CustomAttributes[]=title
CustomAttributesDefaults[align]=right
CustomAttributesDefaults[title]=factbox

You can do the same for your custom tags. CustomAttributesDefaults[] contains predefined value, that will be displayed in custom tag popup window.

Modified on Wednesday 20 June 2007 8:19:46 am by Łukasz Serwatka

Wednesday 20 June 2007 9:08:12 am

Hi Lukasz

Thanks, but that isn't quite what I need. I'd like to set a range of options - something like this: (it was a guess which didn't work)

CustomAttributesOptions[zoom]=12
CustomAttributesOptions[zoom]=14
CustomAttributesOptions[zoom]=16
CustomAttributesOptions[zoom]=18

and have the different zoom levels appear as a drop-down list.

I'm sure I've seen a DisplayName option somewhere too, something which would convert 12, 14 etc to "close", "not so close", "even less close" - or whatever. Think it was in the ezwebin settings somewhere, but I can't find it again.

thanks.

Wednesday 20 June 2007 9:13:56 am

This is not supported for custom attributes. It is supported for CSS class description. Example for ezwebin: ClassDescription[itemized_sub_items]=Itemized Sub Items where friendly name is displayed in dropdown box.

Wednesday 20 June 2007 9:27:48 am

# Wednesday 20 June 2007 9:13:56 am
# This is not supported for custom attributes. It is supported for CSS class description. Example for ezwebin: ClassDescription[itemized_sub_items]=Itemized Sub # Items where friendly name is displayed in dropdown box.

Yep, just discovered that (using AttributeDescription).

How about the option/dropdown thing?

- BTW, so as not to confuse others reading this thread: the [itemized_sub_items] is an eZpublish class, not a CSS class.

regards

Wednesday 20 June 2007 9:40:17 am

> - BTW, so as not to confuse others reading this thread: the [itemized_sub_items] is an eZpublish class, not a CSS class.

yes and no, its both. It's a template override for that and some other classes, so they also define a different behavior.

Wednesday 20 June 2007 9:40:27 am

@Paul:
I'm sorry but you are not correct blunk.gif Emoticon It is CSS class. And override it is based on classification for that embed template. Also itemized_sub_items is used in <div class="object-left itemized_sub_items">. It is not eZ Publish content class.

Modified on Wednesday 20 June 2007 9:46:02 am by Łukasz Serwatka

expandshrink

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

36 542 Users on board!

Forums menu