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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 01:15:04
Script start
Timing: Jan 31 2025 01:15:04
Module start 'layout'
Timing: Jan 31 2025 01:15:04
Module start 'content'
Timing: Jan 31 2025 01:15:04
Module end 'content'
Timing: Jan 31 2025 01:15:04
Script end

Main resources:

Total runtime0.0261 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.2656151.2266
Module start 'layout' 0.00580.0039 739.4922220.7188
Module start 'content' 0.00970.0149 960.21091,001.8359
Module end 'content' 0.02460.0015 1,962.046937.9922
Script end 0.0261  2,000.0391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002710.2342140.0002
Check MTime0.00114.2383140.0001
Mysql Total
Database connection0.00072.696210.0007
Mysqli_queries0.002911.288730.0010
Looping result0.00000.042910.0000
Template Total0.00114.110.0011
Template load0.00083.132610.0008
Template processing0.00020.915810.0002
Override
Cache load0.00062.160210.0006
General
dbfile0.00228.291380.0003
String conversion0.00000.122340.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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