Subdomain per section of the content tree?

Author Message

Carlos Revillo

Monday 27 October 2008 4:44:22 am

Hi. This is maybe a following to http://ez.no/developer/forum/setup_design/one_subdomain_per_each_user_blog

I'll try to explain. We have a content tree like

Root
-- News
-- Contact
-- Company
-- Forum
-- Blogs

We want a subdomain for the "blogs" section. something like blogs.domain.com

So, i have added some lines to my site.ini file

HostMatchMapItems[]=blogs.domain;blogs

and i've created a siteaccess called also blogs.
In this new siteaccess i've added override.ini.append.php file and site.ini.append.php with

IndexPage=/content/view/full/5681

All is perfect but my doubts begins now.

we have a main menu template. is a list of the folders under the content tree. usign ezurl operator we get urls like http://www.domain.com/news, http://www.domain.com/company and so on.

But when i go to blogs.domain.com, ezurl operator converts those urls to http://blogs.domain.com/company for example, and this is not what we want.

so, is there any way to keep those urls like http://www.domain.com/company and only the urls of the nodes in "blog tree" displaying urls like http://blogs.domain.com/whatever...

Andrew Duck

Monday 27 October 2008 6:01:31 am

Hi Carlos,

From memory I don't believe ezurl() takes into account the SiteURL setting within the [SiteSettings] block in site.ini. If this is infact the case then the domain name would be based on HTTP_HOST which is an environment variable defined by Apache.

To work around this you would have to customise your menu template and conditionally change those URLs for specific subtrees.

Andrew Duck, Executive Director, Quiqcorp Limited
eZ Certified Developer and Trainer.
Member of the Community Project Board
http://quiqcorp.com | http://twitter.com/andrewduck

Andrew Duck

Monday 27 October 2008 6:04:36 am

http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_operators/urls/ezurl

Gaetano mentions this in a comment on the ezurl documentation page. :)

Andrew Duck, Executive Director, Quiqcorp Limited
eZ Certified Developer and Trainer.
Member of the Community Project Board
http://quiqcorp.com | http://twitter.com/andrewduck

Carlos Revillo

Monday 27 October 2008 6:10:54 am

I see. And i also have read the comment from Gaetano.

Then we'll need to hack main menu template for this.

Thank you again!

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 19 2025 03:23:51
Script start
Timing: Jan 19 2025 03:23:51
Module start 'layout'
Timing: Jan 19 2025 03:23:51
Module start 'content'
Timing: Jan 19 2025 03:23:51
Module end 'content'
Timing: Jan 19 2025 03:23:51
Script end

Main resources:

Total runtime0.8672 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 589.2891152.6406
Module start 'layout' 0.00740.0038 741.929739.4766
Module start 'content' 0.01120.8546 781.4063553.6719
Module end 'content' 0.86580.0013 1,335.078112.1250
Script end 0.8671  1,347.2031 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.4590160.0002
Check MTime0.00220.2490160.0001
Mysql Total
Database connection0.00130.147910.0013
Mysqli_queries0.811593.5814600.0135
Looping result0.00050.0602580.0000
Template Total0.828895.620.4144
Template load0.00210.237620.0010
Template processing0.826795.333120.4133
Template load and register function0.00040.042710.0004
states
state_id_array0.00110.128210.0011
state_identifier_array0.00100.109620.0005
Override
Cache load0.00170.1977290.0001
Sytem overhead
Fetch class attribute can translate value0.00050.054320.0002
Fetch class attribute name0.00170.198650.0003
XML
Image XML parsing0.00090.104920.0005
class_abstraction
Instantiating content class attribute0.00000.001360.0000
General
dbfile0.00150.1780180.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs