WIll this still work? So say I can setup a look for home page, product detail and product pages? Currently in 8.0.1.2 I have three separate templates.
WIll this still work? So say I can setup a look for home page, product detail and product pages? Currently in 8.0.1.2 I have three separate templates.
So far it looks like it does. We're working on the home page template right now for a new site, and we have a standard template.master as well.
Will be implementing a product.master shortly and will post if we encounter any problems.
Matthew Bertulli
Demac Media
mbertulli@demacmedia.com
Custom Web Design & E-Commerce Development
AspDotNetStoreFront Platinum DevNet Partner
----
Custom Skinning & Design
Web Services Integration
Custom Reporting
Salesforce.com eCommerce AspDotNetStoreFront Integration
Cool thanks. I am apparently a little behind you
Yep..."template" switching (we're going with masterpage skins as the terminology for now...just to keep an essence of familiarity with the design aspect) is functional, as are home templates. I also just made a post about locale template switching here in this thread
<a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>
George,
It seems as though the SkinBase.cs logic for "template switching" isn't working as the v8 was. From what I can see through debugging, the following is where the detection of the appropriately named AppConfig param is detected based on page name: (around line 190)
It appears that CommonLogic.GetThisPageName returned the ShowProduct.aspx in v8, but in v9 it returns the rewritten URL (i.e. p-1-product.aspx).// undocumented feature:
templateName = AppLogic.AppConfig("Template" + CommonLogic.GetThisPageName(false));
So right now, in v9, specifying an AppConfig of TemplateShowProduct.aspx does not result in the appropriate Master page file being loaded.
Matthew Bertulli
Demac Media
mbertulli@demacmedia.com
Custom Web Design & E-Commerce Development
AspDotNetStoreFront Platinum DevNet Partner
----
Custom Skinning & Design
Web Services Integration
Custom Reporting
Salesforce.com eCommerce AspDotNetStoreFront Integration
Matt,
Does adding the rewritten URL to the appconfig resolve the issue? This is a result of changing over to the ASP.NET Routing engine for URL Rewrites.
- Dan
Adding the re-written URL to the AppConfig does resolve the issue, but doesn't really help the business-case for broad based Product, Category, Manufacturer Templating (or in v9, lack there of).
It's not really plausible to have to specify a template per product, or per category. Most sites we've built have a product template, category template, home template, and checkout process template.
I might just modify SkinBase to add some extra logic that would bring back the needed functionality.
Matthew Bertulli
Demac Media
mbertulli@demacmedia.com
Custom Web Design & E-Commerce Development
AspDotNetStoreFront Platinum DevNet Partner
----
Custom Skinning & Design
Web Services Integration
Custom Reporting
Salesforce.com eCommerce AspDotNetStoreFront Integration
So I guess we are saying template switching does not work? Yikes
I think with a few lines of code in the SkinBase.cs file, it can be re-enabled quite easily.
We're playing with this right now. Will post an update shortly.
Matthew Bertulli
Demac Media
mbertulli@demacmedia.com
Custom Web Design & E-Commerce Development
AspDotNetStoreFront Platinum DevNet Partner
----
Custom Skinning & Design
Web Services Integration
Custom Reporting
Salesforce.com eCommerce AspDotNetStoreFront Integration
Template switching works fine. The URL format is different however, so you need to create an appconfig such as TemplateP-11-myproduct.aspx and assign the template there, instead of showproduct.aspx.
We have a discussion item in to support both methods, however the upside to the current implementation is that it gives a much greater degree of flexibility (you could have a masterpage for each product if you wanted).
You can also re-enable the old way by going into showproduct.aspx and in the Page PreInit event, just set Page.MasterPageFile = "~/App_Templates/Skin_1/custom.master"; and the page will use that file.
- Dan
Any progress for template switching ??
I have done with template switching for the master pages. I modified some code in the skinbase .cs. Now i am able to make templates for the product, category , section and other pages like (For category i am using CategoryTemplate.master etc).
If any one want this then please email to info@silexsoftwares.com
ssgumby,
We just added the following to our showproduct.aspx.cs "OverrideTemplate" member.
Basically did this for showproduct, showcategory, and showsection.//DEMAC
if (!string.IsNullOrEmpty(AppLogic.AppConfig("Templat eShowProduct.aspx").ToString()))
HT = AppLogic.AppConfig("TemplateShowProduct.aspx").ToS tring();
Matthew Bertulli
Demac Media
mbertulli@demacmedia.com
Custom Web Design & E-Commerce Development
AspDotNetStoreFront Platinum DevNet Partner
----
Custom Skinning & Design
Web Services Integration
Custom Reporting
Salesforce.com eCommerce AspDotNetStoreFront Integration
Do people seriously use this cart with a number of products low enough to do it this way? Talking about a daunting task of creating all the appconfigs...and wouldn't that make the cache get astronomically large and slow if done this way?
This would be a good way for templating topics...but would probably still make more sense to add a template reference to each topic for ease of administration.
I can do customizations to make the functionality work...but i'd rather have it done in the distribution so it's an easier upgrade path each time.
Thanks for your consideration.
I totally agree jjdunkel
The template switching was a huge factor in the convenience of this cart, and yes I can make code changes like Matt did (thanks Matt!) but it would be nice to be built in.
The Template Switching doesn't seem to be working AT ALL for me in 9.0.1.2 unless i add the following to the codebehind of the page i'm trying to template.
For instance for it to work for topics i had to add this to driver.aspx.cs
and an appconfig for the topic "history": name="Templatet-history.aspx" value="company.master"
I see some language in skinbase.cs, but it's not working without adding the below code to each file.
Code:protected override string OverrideTemplate() { String TemplateName = AppLogic.AppConfig("Template" + CommonLogic.GetThisPageName(false)); if (TemplateName.Trim().Length == 0) { TemplateName = "template"; } if (base.IsMobile) { TemplateName = "mobile_" + TemplateName; } if (TemplateName.EndsWith(".ascx")) { TemplateName = TemplateName.Replace(".ascx", ".master"); } if (!TemplateName.EndsWith(".master", StringComparison.OrdinalIgnoreCase)) { TemplateName = TemplateName + ".master"; } if (!CommonLogic.FileExists(CommonLogic.SafeMapPath("~/App_Templates/" + CommonLogic.IIF(base.IsMobile, "MobileSkin_", "Skin_") + base.SkinID.ToString() + "/" + TemplateName))) { TemplateName = CommonLogic.IIF(base.IsMobile, "mobiletemplate.master", "template.master"); } return TemplateName; }
For what it is worth, rather then having to specify in each masterpage file in the directive as well as the code behind, we added this little mod to the skinbase.cs: replacing the original:
With this:C#/VB.NET Code:
this.MasterPageFile = "~/App_Templates/" + SkinDirectory + "/" + m_TemplateName;
this.Theme = PageTheme;
This way if you have taken the time to specify the MaterPageFile="~/App_Templates/Skin_99/MyCustomTemplate.master" the skin base will honor it.C#/VB.NET Code:
// If this.MasterPageFile is not the out of the box skin_1/template.master then the develper said what one he/she wants to use. so dont override it .. ever..
if (String.IsNullOrEmpty(this.MasterPageFile) || this.MasterPageFile.ToLower() == "~/app_templates/skin_1/template.master" || IsMobile)
{
this.MasterPageFile = "~/App_Templates/" + SkinDirectory + "/" + m_TemplateName;
this.Theme = PageTheme;
}
else
{
String[] masterPageFile = this.MasterPageFile.Split('/');
m_TemplateName = masterPageFile[masterPageFile.Length-1];
this.Theme = masterPageFile[masterPageFile.Length - 2];
}
The only side effect is that you can only do DYNAMIC template switching when the MasterPageFile= Directive is set to what aspdnsf uses out of the box "~/App_Templates/Skin_1/template.master"
Hi I am using version 8.0.1.2 and I would like to move the site to version 9.0.1.3.
I am currently using TemplateSwitching for everything Categories , product page etc.
and I would like to using it but I don't understand how master pages works yet.
Are masterpages replacing template.ascx?
How can I replicate the templateSwitching below with masterpages in version9.0.1.3?
templatecheckoutanon.aspx ----> templatenoleftmenu_admin.ascx
I hope someone can help me
Thank you
Hi
I have just tried to apply template switching with one categories but is not working.
I am entering the new template below in the categories Use Skin Template: field but the template master is not switched.
template.master_nomenu.master
am doing something wrong?
Thank you
That won't work out of the box in 9.0.1.3. If you contact support we can send you an update that'll fix that.
Thank you Scott !
Did this get addressed at all in 9.0.1.3? I haven't seen a change log for that version yet.
And thanks for the suggestion cjbarth