Forums / Setup & design / How to match specific site designs with specific content - Help!

How to match specific site designs with specific content - Help!

Author Message

RW Wood

Monday 15 September 2003 7:52:03 pm

I've been going around in circles trying to understand nodes, classes, sections, etc., and I still can't figure out how to configure ezP so that, if I want an article to show up displayed on pagelayout1.tpl, that's where it is. To illustrate, my site has several countries, all of which have the same general pagelayout.tpl, but each of which has some specific includes such as images, etc. that make them different. How do I now assure that an article, or an image, or whatever content I may have shows up displayed with a specific country's pagelayout?

I thought that version three was going to get me away from the need I had in version 2 to modify a ton of files everytime I wanted to make a change to the overall site, and the docs indicate that should be the case, but I can't figure this one out.

Thanks.
RWW

Bjørn Kaarstein

Tuesday 16 September 2003 1:15:22 am

Hi.

This could be divide into sections, but as you say, you'll have quite a few pagelayouts to attend to if you want to go that way.

I assume that you have divided your countries into folders in the admin interface. If so, you could use a switch/case statement matching on $node.node_id in your pagelayout, where you show your country-specific items within the different cases.

You could also use section show=.... to differ.

If you have divided your countries into sections, you still can use the switch/case statement matchin on section.

I'm not quite sure though, how a huge switch/case statement will affect the overall performance.

Regards Bjørn

RW Wood

Tuesday 16 September 2003 9:16:45 am

It seems illogical that, with all the versatility built into ezP 3, there's not a simple solution to this. Essentially, I think it boils down to telling ezP, "If any content in the Peru folder is accessed, use the Peru site.ini.append file, but if content from the Chile folder is accessed, use the Chile site.ini.append file" After all, that's where the site design is set for the display information. That way, the different site design folders can be accessed in which only the pieces of the whole pagelayout that are different from the standard are found.

My understanding of php coding is next to nil, so I don't know how overly simple my understanding of the problem is, but it seems like this would be a logical part of the program.

Thanks.
RWW

Paul Borgermans

Tuesday 16 September 2003 9:38:00 am

You are right that this is a basic property of 3.x, but imho you should use different siteaccess to select the layout, specific images and even language.

For thsi route, you need to go into multiple sites with uri based siteaccess. I the override.ini.append of each site, you specify the design tree to use.

For example:

http://mysite.com/peru becomes the "virtual site" for peru and http://mysite.com/chile the virtual site for chile..

You need to setup two site accesses and two designs called peru and chile which differ only for some country specific files.

You specify the siteaccesses in your settings/override/site.ini.append.php as:

----------
[SiteAccessSettings]
...
AvailableSiteAccessList[]=peru
AvailableSiteAccessList[]=chile

MatchOrder=uri
--------

By specifying MatchOrder=uri, ezp picks up the first element of the URL and uses the settings and design depending on what it finds there

It is really simple. If you are on linux/unix, you can even symlink the design directories for almost all files except a few images or other design elements you want to have specific. No need to edit a lot of files, only the ones that are different

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

RW Wood

Tuesday 16 September 2003 11:20:26 am

Paul said:
>You specify the siteaccesses in your >settings/override/site.ini.append.php as:
>
>----------
>[SiteAccessSettings]
>...
>AvailableSiteAccessList[]=peru
>AvailableSiteAccessList[]=chile

That's exactly what I've done. Following is that portion of my settings/override/site.ini Eventually there will be several more countries added.

[SiteAccessSettings]
CheckValidity=false
AvailableSiteAccessList[]=argentina
AvailableSiteAccessList[]=ggila
AvailableSiteAccessList[]=ggila_admin
MatchOrder=uri
SiteAccessList[]=argentina
SiteAccessList[]=ggila
SiteAccessList[]=ggila_admin
HostMatchMapItems[]

And that works fine as far as entering a url like http://www.mysite.com/index.php/argentina. The page comes up using the stylesheet and images that are specific to that part of the site. But what about an article that I only want to appear on the Argentina page. That's where I can't make the connection between actual content and how it gets displayed.

This and my problem with the site designs refusing to use the standard fallback templates are keeping me from moving ahead with ezP3.

Thanks.
RWW