Creation of Custom Theme :: Not Loading Appropriate Files - General Discussions - General Discussions - Progress Community
 General Discussions

Creation of Custom Theme :: Not Loading Appropriate Files

  • Creation of Custom Theme :: Not Loading Appropriate Files
  • Hello -

    I went ahead and started to crack open SF 4 today on our test servers.  I walked through the designers guide to morph a template I already had into SF's newest version.  I went ahead and created the directory structure (and populated the files) on my SF install and hoped things would start working.  I went through and added a new Theme through the Dashboard and then applied that theme to it's custom MasterPage file.

    Masterpage code:
    01.<%@ Master Language="C#" %>
    02.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    03.<script runat="server"> </script>
    04.<html xmlns="http://www.w3.org/1999/xhtml" >
    05.<head runat="server">
    06.    <asp:contentplaceholder id="head" runat="server" />
    07. 
    08.</head>
    09.<body>
    10.    <form id="form1" runat="server">
    11.        <asp:ScriptManager ID="ScriptManager1" runat="server">
    12.        </asp:ScriptManager>
    13.         
    14.    <div id="wrapper">
    15.        <div id="wrapperInner">
    16.            <div id="heading">
    17.                <div id="headingInner">
    18.                    <asp:contentplaceholder id="cphHeading" runat="server"></asp:contentplaceholder>
    19.                </div>
    20.            </div>
    21.            <div id="banner">
    22.                <div id="bannerInner">
    23.                    <asp:contentplaceholder id="cphBanner" runat="server"></asp:contentplaceholder>
    24.                </div>
    25.            </div>
    26.            <div id="nav">
    27.                <div id="navInner">
    28.                    <asp:contentplaceholder id="cphNavigation" runat="server"></asp:contentplaceholder>
    29.                </div>
    30.            </div>
    31.            <div id="content">
    32.                <div id="contentInner">
    33.                    <div class="mainBody">
    34.                        <div class="mainBodyInner">
    35.                            <asp:contentplaceholder id="cphMainContent" runat="server"></asp:contentplaceholder>
    36.                        </div>
    37.                    </div>
    38.                    <div class="sidebar">
    39.                        <div class="sidebarInner">
    40.                            <asp:contentplaceholder id="cphSidebar" runat="server"></asp:contentplaceholder>   
    41.                        </div>
    42.                    </div>
    43.                    <div class="clearContent"></div>
    44.                </div>
    45.                <div class="clearContent"></div>
    46.            </div>
    47.        </div>
    48.    </div>
    49.    <div id="footer">
    50.        <div id="footerInner">
    51.            <asp:contentplaceholder id="cphFooter" runat="server"></asp:contentplaceholder>
    52.        </div>
    53.    </div>
    54.    <div id="subFooter">
    55.        <div id="subFooterInner">
    56.            <asp:contentplaceholder id="cphSubFooter" runat="server"></asp:contentplaceholder>
    57.        </div>
    58.    </div>
    59.    </form>
    60.</body>
    61.</html>

    With all of this said, I created a sample page with the MasterPage (with Theme) applied, and the compiled code outputs a completely unformatted website in the browser.  My directory structure is:

    ~\App_Data\Sitefinity\WebsiteTemplates\testTheme\App_Master\ (MasterPage.master)
    ~\App_Data\Sitefinity\WebsiteTemplates\testTheme\App_Themes\original\
    ~\App_Data\Sitefinity\WebsiteTemplates\testTheme\App_Themes\original\Global (main.css and other CSS files)
    ~\App_Data\Sitefinity\WebsiteTemplates\testTheme\App_Themes\original\CSS
    ~\App_Data\Sitefinity\WebsiteTemplates\testTheme\App_Themes\original\Images

    Does anyone know why I would be getting a style-less site?  If I have not provided enough information, please let me know what else I can give you, and I will be glad to do so.

    Thank you!
  • Hello Chris,

    Could you observe the response from the request to the Css classes ? There must be some more detailed information like the actual reason for this behavior - not found, you do not have permissions to access the file etc.

    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Ivan -

    We're getting "File Not Found" errors when the CSS attempts to load. One thing we did notice was that the file path that it was pulling was incorrect:

    /Sitefinity/WebsiteTemplates/testTheme/App_Themes/original/global/joe.css

    Notice the "App_Data" folder is missing from that string.  Just to test, we decided to create the structure above, and that actually worked.  We double checked permissions on the App_Data folder as well as over the entire root directory, and we found that all the appropriate accounts were given the correct level of access.

    Any comments or suggestions?  I appreciate your time!
  • Hi Chris,

    App_Data is missing from the actual path because of an internal route handler. Since the App_Data folder is protected by ASP.NET you cannot simply directly link to resources in this folder. You will get a 403 exception for this. This is why we have an internal route handler which serves resources from themes stored in App_Data. What you have to do is to correctly register the theme in Administration -> Settings -> Advanced -> Appearance -> Frontend Themes (~/App_Data/Sitefinity/WebsiteTemplates/testTheme/App_Themes/original/). Notice that forward slashes are used.

    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • Radoslav-

    I went and double checked the path for the theme directory, and it is exactly what you have in your previous post.  When going through the Guidebooks, it never said anything about filling in the "Namespace" and "AssemblyInfo" areas of that form.  Is something needed there, or would there be any other issues causing the theme to not show appropriately?
  • Hi Chris,

    Thank you for getting back to us.

    Can you please open up the sample website which gets installed with the Sitefinity installation and see how the themes are registered and how they are used on templates? Since you are not using a theme which is embedded into a dll file you do not need to fill in assembly and namespace fields.

    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • We looked at the sample sites and what we have matches up exactly like the samples.  The page is adding in the links to the CSS files, but it is not loading them appropriately.  If we hard-code the styles straight onto the MasterPage, the site pulls up perfect.
  • Hello Chris,

    Is it possible that you send us a sample project where this problem reproduces? Or provide us with a live link to a page where we can observe the behavior? It is preferable that you open up a support ticket for those actions.

    Greetings,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • same problem a am facing.I am apply a theme but it is not applying to my template ..
  • Hi zaheer,

    We sent several replies to your feedback request.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  • I have the same problem

    www.sitefinity.com/.../register-theme.aspx

    Markus
  • Me too...
  • I'm facing the same problem.
    I've just deployed my dev site (local) in a server and everything is fine except that themes are not being applied...
  • Hello,

    Please make sure that your custom themes are registered as described in the designers guide (step 9). Make sure that you are using application relative paths.

    Best wishes,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items