Forums / Setup & design / Adding options to Custom Tags

Adding options to Custom Tags

Author Message

paul bolger

Tuesday 19 June 2007 10:44:51 pm

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.

Paul Bolger

Łukasz Serwatka

Tuesday 19 June 2007 11:18:24 pm

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.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

paul bolger

Wednesday 20 June 2007 12: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.

Paul Bolger

Łukasz Serwatka

Wednesday 20 June 2007 12: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.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

paul bolger

Wednesday 20 June 2007 12: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

Paul Bolger

André R.

Wednesday 20 June 2007 12: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.

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

Łukasz Serwatka

Wednesday 20 June 2007 12:40:27 am

@Paul:
I'm sorry but you are not correct ;) 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.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

eZ debug

Timing: Jan 31 2025 04:21:16
Script start
Timing: Jan 31 2025 04:21:16
Module start 'content'
Timing: Jan 31 2025 04:21:16
Module end 'content'
Timing: Jan 31 2025 04:21:16
Script end

Main resources:

Total runtime0.1541 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 587.9297180.8359
Module start 'content' 0.00460.0053 768.7656101.9922
Module end 'content' 0.00990.1441 870.7578530.3047
Script end 0.1540  1,401.0625 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00322.0750200.0002
Check MTime0.00130.8752200.0001
Mysql Total
Database connection0.00050.341210.0005
Mysqli_queries0.109771.19411410.0008
Looping result0.00140.89401390.0000
Template Total0.143893.310.1438
Template load0.00080.502310.0008
Template processing0.143092.774710.1430
Override
Cache load0.00050.335410.0005
Sytem overhead
Fetch class attribute can translate value0.00070.468610.0007
XML
Image XML parsing0.00020.133010.0002
General
dbfile0.00664.3123200.0003
String conversion0.00000.002630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs