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 2 of 2

Thread: Skin Switching Based on Entity and Topics

  1. #1
    dayhawk is offline Member
    Join Date
    May 2009
    Posts
    76

    Default Skin Switching Based on Entity and Topics

    I'd like to accomplish the following:

    If a page's parent entity is category, then use template (or skin #).

    And the following:

    If the topic page is t-birthday.aspx, then use template (or skin #).

    Is something like this easily doable?

    Thanks in advance.

  2. #2
    cjbarth is offline Senior Member
    Join Date
    Oct 2008
    Posts
    392

    Default

    Do you want to change the template if it is only a certain category or a certain template?

    In either case you can override the routine OverrideTemplate in the pages that render topic and categories (found in web.config).

    Code:
    <add name="Category" url="c-{CategoryID}-{SEName}.aspx" virtualPath="~/showcategory.aspx" checkPhysicalUrlAccess="false" />
    <add name="Topic" url="t-{Topic}.aspx" virtualPath="~/driver.aspx" checkPhysicalUrlAccess="false" />
    In the OverrideTemplate routine you can use logic to detect which category or topic you are looking at and then change the template based on that.

    Otherwise you can use a method like the one discussed here: http://forums.aspdotnetstorefront.co...ad.php?t=22665
    ML9.3.1.1
    SQL 2012 Express
    VS 2010
    Azure VM