Forums / Developer / Datatype selection options values with multisite

Datatype selection options values with multisite

Author Message

Alex Saintilan

Thursday 26 July 2007 1:26:45 am

Is there a way for a same class to have different options values depending on the site ?
I am using a class <i>document</i> with an attribute <i>theme</i> (datatype selection).
The theme needs to be different on each site.

I know i can do this by overriding template ezselection.tpl but ii would rather find a solution with configuration file.

Thank you in advance for any answers.

Kristof Coomans

Thursday 26 July 2007 3:00:28 am

Hi Alex, and welcome to the eZ community!

No, this is not possible. Maybe we can find an alternative solution for your problem, if you explain us a bit more what exactly you need to achieve?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Alex Saintilan

Thursday 26 July 2007 8:47:11 am

I have several sites on an ezpublish instance.
I have one class <i>Document</i> with an attribute <i>theme</i> (datatype : selection).
Each site needs to have its own themes but they are declared once in the class.

Is there a way to override the options of a selection datatype attribute of a class ?
Or should I create a class per site only to change the options of an attribute ?

André R.

Thursday 26 July 2007 11:33:28 am

This is as previous said not best done with selection, you could solve it in several ways.

1. having the filed as a object relations with drop down and restrict the related themes each site can select with read rights. So you need to create a theme class, and place all the theme objects in a specific subtree.

2. use a ezstring filed and override the template to show a drop down box instead of string input. The values in the drop down can then be generated by some ini setting and what site the object is placed in. Downside is that the a specific selection will still be stored in the object even if you delete it from the ini file, so they need to re edit the objects if they use a option you need to remove.

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

Donat Fritschy

Friday 27 July 2007 9:32:05 am

Hi Alex

if you use multiple sites, you have different siteaccesses, dont't you? Do they need to share the same database? If not, there should be no problem. Or did I miss the point?

Regards
Donat

http://www.webmanufaktur.ch - Developers united in eZ Publish: http://www.cjw-network.com

Alex Saintilan

Tuesday 31 July 2007 1:02:45 am

Hi Donat,

All my sites need to share the same database.
After a few test, the André's first solution seems to be the good one.

Thanks for your answers.

eZ debug

Timing: Jan 18 2025 11:38:43
Script start
Timing: Jan 18 2025 11:38:43
Module start 'content'
Timing: Jan 18 2025 11:38:44
Module end 'content'
Timing: Jan 18 2025 11:38:44
Script end

Main resources:

Total runtime1.1371 sec
Peak memory usage4,096.0000 KB
Database Queries207

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 589.2578180.8125
Module start 'content' 0.00830.9763 770.0703661.5078
Module end 'content' 0.98460.1524 1,431.5781337.0547
Script end 1.1370  1,768.6328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3493210.0002
Check MTime0.00150.1356210.0001
Mysql Total
Database connection0.00180.160010.0018
Mysqli_queries1.052292.53412070.0051
Looping result0.00250.22072050.0000
Template Total1.094696.320.5473
Template load0.00200.177320.0010
Template processing1.092596.084420.5463
Template load and register function0.00020.020510.0002
states
state_id_array0.00170.146810.0017
state_identifier_array0.00240.212020.0012
Override
Cache load0.00170.1535340.0001
Sytem overhead
Fetch class attribute can translate value0.00240.207350.0005
Fetch class attribute name0.00120.105890.0001
XML
Image XML parsing0.00200.172650.0004
class_abstraction
Instantiating content class attribute0.00000.001390.0000
General
dbfile0.00360.3137400.0001
String conversion0.00000.000730.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs