Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 4 of 4

Thread: showproduct.aspx with alternate master template?

  1. #1
    omairkha is offline Member
    Join Date
    Aug 2011
    Posts
    89

    Question showproduct.aspx with alternate master template?

    Hi,

    I need to create a custom showproduct page which uses a different master template than the rest of the site.

    I will still be keeping the original showproduct.aspx which uses the default template.master but is there a way to create showproductCustom.aspx which uses the templateCustom.master?

    I've tried changing the MasterPageFile tag in showproductCustom.aspx but that had no affect.

    Anyone know how I can do this?

    Thanks!

    Using v9.1.0.1
    Last edited by omairkha; 03-07-2012 at 05:33 PM. Reason: corrected typeo

  2. #2
    mjg is offline Member
    Join Date
    Jan 2006
    Posts
    34

    Default

    How are you planning on differentiating products that go to the "standard" product page and one that goes to your "custom" product page? Will you be providing unique URL structure (like /q-123-product.aspx as opposed to /p-123-product.aspx) and then adding that new route into the web.config?

    Or did you just have specific products that you want to use this unique template? If so you would just need to turn TemplateSwitching.Enabled to True, define a new appconfig called Templatexxxxxxxxxx.aspx (where xxxxxxxx.aspx would be the page names for each specific product to get this template) that has a value of the name of the special template for your show product pages.

    MJG
    EMM - Enhanced Email Manager

  3. #3
    omairkha is offline Member
    Join Date
    Aug 2011
    Posts
    89

    Default

    Hi MJG-

    Thanks for the reply.

    The products will mainly be using the original showProduct.aspx

    The custom page will only be called by clicking on a link using the ProductID, for example:
    http://somesite.com/showProductCustom.aspx?ProductID=7

    So I don't really need any logic that will determine when to select between the two, but only when a user clicks on a link to display the alternate layout.

    This is particularly useful if it can be done, specially for creating a Printer Friendly page, etc.

    Thanks!

  4. #4
    mjg is offline Member
    Join Date
    Jan 2006
    Posts
    34

    Default

    That is actually easier to do then since we don't have to worry about routing.

    Just turn template switching on as explained earlier, then add an appconfig variable called templateshowProductCustom.aspx with a value of the name of your custom template, reset the cache and you should be good to go.

    While I haven't tried it, the addition of the querystring parameter shouldn't cause a problem with the template switching.

    Best of luck!
    EMM - Enhanced Email Manager