Developer forum

Forum » CMS - Standard features » Multiple template folders in the same solution

Multiple template folders in the same solution

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a solution running on DW 9.10.x based on Rapido.

We have multiple solutions on it and because of the template differences, we had to create separate template folders.

The problem I have is when the server recycles. The Parsed files generated, are based on the Rapido folder for all websites, no matter what Layout is set on the website.

I have tried changing the IDs of the GridRows but I get some nasty errors in the back-end on the website using the Rapido folder because the GridRows definitions are not found.

This is a very serious issue because it affects production-ready websites and we are liable for caused damages. 

I need a fast solution on how to solve this overlapping of the templates.

Thank you,

Adrian


Replies

 
Nicolai Pedersen
Reply

Hi Adrian

Parsed files are layouts only, right?

And we did not exactly test for these scenarios. There are a lot of places in the template where you have paths like  "/Files/Templates/Designs/Rapido/" and you of course have to ensure you are not having that reference in any templates in a design folder with another name that "Rapido".

Also you might want to check the database - espescially page and area table - for references to layouts/designs that does not fit your setup.

Also check default layouts in websitelayouts_{areaid}.xml in system/items

Also the dynamicweb.rapido.dll has references to i.e. a configuration of "LessConfiguration/DesignName" in globalsettings that handles things like less compilation - and that will have a hard time running in multiple folders wihtout being rewriten.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Parsed files are layouts. The ones generated in _parsed folder in each Design folder.

The LessConfiguration (Less_{areaid}.config) has also been changed and the compilation is happening in the right place.

In the database in Page/PageLayout I only have a few exceptions that are not using the default layout and they are just the names of the files. Not the entire path. Therefore no conflict there:

The Area table shows correctly the path to the right Design folder:

websitelayouts_{areaid}.xml has no specific information about the paths.

I have not found any reference to Rapido in the GlobalSettings.aspx file.

I am running out of options.

Adrian

 

 

 
Nicolai Pedersen
Reply

In you master.cshtml (and probably other places) you have this:

BlocksPage.GetBlockPage("Master");

I think it would help if it is unique for each design folder:

BlocksPage.GetBlockPage("MasterAgricoverCorporate");
 
Nicolai Pedersen
Reply

Or replace all of them with this:

BlocksPage masterPage = BlocksPage.GetBlockPage("master" + Dynamicweb.Frontend.PageView.Current().Layout.Design.Name);

In that way they will all be in the context of their design

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Thank you for the suggestion.

How about changing the Grid Settings instead?

@Model.Grid("Grid", "Grid", "default:true;sort:1", "Corporate")

Would that help separate the templates of the GridRows?

If I try to just change the ID of the GridRows without changing the Layout (Pages) I get yellow errors in the interface on the solution running Rapido.

I guess a change of the layout combined with a change of GridRowIds would work?

Adrian

 
Nicolai Pedersen
Reply

You can change that, but I do not think it is related to this issue.

When you change the grid in code, you also have to change all the references in the database to that grid. I think that is causing the yellow screen. Or give me the exception and I can see what it might be.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Indeed. That was the issue.

But I was planning on updating the records in the database as well.

Your suggestion for changing the MasterBlockID is cleaner. If you are sure it would solve the issue, I would rather go with that since it has fewer implications.

Adrian

 

You must be logged in to post in the forum