Hosting Multiple Sites - Skins not rendering

A place for discussion about skinning and design. Before posting questions here you should review the documentation about creating skins.

This thread is closed to new posts. You must sign in to post in the forums.
8/30/2010 1:36:46 PM
TJ
Gravatar
Total Posts 19

Hosting Multiple Sites - Skins not rendering

I'm hoping someone may have some advice or experience with this...

I have one installation of MojoPortal on my web server that is set up using Multiple Sites Based on Host Names.  

System info:

mojoPortal Version 2.3.5.1 MSSQL
Operating System Microsoft Windows NT 5.2.3790 Service Pack 2
ASP.NET Version v2.0.50727 Running in Full Trust

 

On site 1: I am using a skin made with Artisteer version 2.3 - CSS + images are rendering correctly.

On site 2:  The skin has been made using Artisteer version 2.4 to take advantage of the vertical menu, but some elements will not render.

Specifically, all of the art-blockcontent images won't show up (art-BlockContent-cl,art-BlockContent-cr, etc) for the side bars.  Any CSS for AspNet-GridView used in the Members List or Shared Files does not display at all.

 

I understand if the hosting is in Medium Trust using different versions of Artisteer can be problematic - does this still apply if the host is Full Trust?

The weird thing is that locally I have MojoPortal set up based on Folder Names and the two different version skins render correctly.

I reinstalled MojoPortal to see if the problem would correct on the web host, but no such luck.

 

Thanks in advance.

TJ

8/31/2010 7:33:13 AM
Gravatar
Total Posts 18439

Re: Hosting Multiple Sites - Skins not rendering

Hi TJ,

This issue actually came to my attention recently and is already fixed in the latest code in the source code repository. It will be fixed in the next release.

Basically it is a long standing bug, it has been there a long time but was not very noticeable because for years there were not many differences in the theme.skin file used in different skins included with mojoPortal. But as we added support for Artisteer 2.3 and then 2.4/2.5 and also the new jQueryUI skin, we now have important differences between theme.skin files used in each skin and the problem became more apparent.

What happens is:

In .NET 3.5 Medium Trust, VirtualPathProvider does not work so all skins in all sites use the theme.skin from /App_Themes/default/theme.skin instead of the one in the skin folder. 

In .NET 4 VirtualPathProvider does work in Medium Trust and of course it works in Full Trust in both .NEWT 3.5 and 4.0

But there was still a problem until my recent fix because of the way the caching of themes was happening.

ASP.NET really wants and requires all themes (.skin files) to live in the App_Themes folder. What we do with the VirtualPathProvider is we make the runtime think it is getting the theme.skin file from the /App_Themes/default folder but we feed it the file from the skin folder. The problem is that it gets cached based on the path it thinks the file is located at, ie /App_Themes/default/theme.skin. So in a multi site installation what was happening was that the first site to get traffic would end up populating the cache with its theme.skin file and then when the other site requests the same path App_Themes/default/theme.skin it gets the copy that is already in the cache which is from the other site. Again, this would not be noticeable if both sites were using similar skins ie all sites using Artisteer 2.4 skins works fine. But the problem became noticeable if using incompatible themes across sites, like Artisteer 2.3 needs different settings than Artisteer 2.4/2.5, and jQueryUI needs different settings than those and so on.

So, what I had to do was add logic to make each site request a different theme so they get cached separately like /App_Themes/default1/theme.skin, /App_Themes/default2/theme.skin and so on by appending the site id to the requested skin name. Of course this introduced a new problem because those folders don't actually exist, so I had to add some logic in the VirtualPathProvider to fool the runtime into thinking those folders/files do exist.

Anyway, that is the long explanation of the problem and how it went un-noticed for so long. 

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.