More in this section

Forums / General Discussions / Creation of Custom Theme :: Not Loading Appropriate Files

Creation of Custom Theme :: Not Loading Appropriate Files

24 posts, 0 answered
  1. Chris
    Chris avatar
    4 posts
    Registered:
    29 Dec 2010
    29 Dec 2010
    Link to this post
    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!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    29 Dec 2010
    Link to this post
    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
  3. Chris
    Chris avatar
    4 posts
    Registered:
    29 Dec 2010
    30 Dec 2010
    Link to this post
    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!
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    30 Dec 2010
    Link to this post
    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
  5. Chris
    Chris avatar
    4 posts
    Registered:
    29 Dec 2010
    30 Dec 2010
    Link to this post
    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?
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    04 Jan 2011
    Link to this post
    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
  7. Chris
    Chris avatar
    4 posts
    Registered:
    29 Dec 2010
    04 Jan 2011
    Link to this post
    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.
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Jan 2011
    Link to this post
    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
  9. zaheer
    zaheer avatar
    1 posts
    Registered:
    12 Jan 2011
    08 Feb 2011
    Link to this post
    same problem a am facing.I am apply a theme but it is not applying to my template ..
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    08 Feb 2011
    Link to this post
    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
  11. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    08 Feb 2011
    Link to this post
    I have the same problem

    http://www.sitefinity.com/devnet/forums/sitefinity-4-x/bugs-issues/register-theme.aspx#1519226

    Markus
  12. OC
    OC avatar
    129 posts
    Registered:
    17 Nov 2004
    09 Feb 2011
    Link to this post
    Me too...
  13. John
    John avatar
    22 posts
    Registered:
    14 Jan 2011
    09 Feb 2011
    Link to this post
    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...
  14. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    15 Feb 2011
    Link to this post
    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
  15. Richard
    Richard avatar
    63 posts
    Registered:
    20 Jan 2010
    24 Feb 2011
    Link to this post
    Did anyone resolve this as I am now having the exact same problem trying to deploy my site on our staging server.
    thanks
  16. Greg
    Greg avatar
    82 posts
    Registered:
    08 Aug 2012
    02 Mar 2011
    Link to this post
    I'm having the exact same issue as everyone else. Could the route handler be causing this? I have my path specified exactly as directed in the design guide, but when I view the page source it lists they stylesheet as /Sitefinity. If I hardcode the CSS files, they work fine. Can anyone from Telerik weigh in with a solution?

    Thanks,
    Greg
  17. Tyler Smith
    Tyler Smith avatar
    7 posts
    Registered:
    03 Dec 2004
    03 Mar 2011
    Link to this post
    Ok, figured out what was happening in my case. I'm on IIS6 for my dev box, and I missed the wildcard mapping step as outlined here: http://www.sitefinity.com/blogs/joshmorales/posts/11-02-23/installing_sitefinity_4_on_iis_6.aspx

    As soon as I added that, themes work properly.

    : Greg
  18. James
    James avatar
    3 posts
    Registered:
    16 Mar 2011
    17 Mar 2011
    Link to this post
    I'm having this same issue as everyone else:
     Windows 7
     Telerik Internal Web-server
     no css
  19. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    23 Mar 2011
    Link to this post
    Hello James,

    Do you still have issues with custom templates? We are not able to recreate your problems locally. There are several themes and templates on the market place and out SDK which you can test.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
  20. John
    John avatar
    22 posts
    Registered:
    14 Jan 2011
    28 Mar 2011
    Link to this post
    Hi,

    My problem solved just as Tyler said. (The wildcard mapping is the key!)

    John
  21. Helga
    Helga avatar
    6 posts
    Registered:
    05 Apr 2011
    12 Apr 2011
    Link to this post
    I'm having same problem. Adding wildmap and other advices don't help, CSS not found.
    I tried other template, page is adding in the links to the CSS, but it is not loading them
  22. Katia
    Katia avatar
    194 posts
    Registered:
    01 Jul 2016
    15 Apr 2011
    Link to this post
    Hello,

    One think I can think of which might cause such problem, if the theme is registered and applied correctly, is that the folder in which you have placed the theme does not have read permissions. Please check the permissions of the folder.

    Also, if you have subfolders of Global folder and you have placed the CSS files in them, they will not be loaded. Check for spelling mistakes as well.

    Greetings,
    Katia
    the Telerik team

  23. cli
    cli avatar
    50 posts
    Registered:
    21 May 2007
    02 Sep 2011
    Link to this post
    Just wanted to say the wildcard fix worked for me as well.  I have the same scenario as others.  Works fine on my local machine but when I went to test on my test server themes weren't loaded.  Server is Win2k3 IIS6.  I did finally find the blog post referenced in the 4.2 manual under "see also."  A bit annoying as it really should be part of the installation steps rather than a footnote at the bottom.  That's why I missed it.

    I love telerik products.  I use them in every site I build now and can't imagine building one w/o them.  However, finding real world examples and solutions I always end up having to sift through forum and blog posts.  Sometimes taking forever and sometimes to no avail.  It would be nice if (and make more sense) if you integrated the info into the manual over time.   
  24. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    28 Aug 2017
    03 Sep 2011
    Link to this post
    Hello Cli,

    We're glad to hear that the issue you were facing has now been resolved. Thank you for the constructive input, we really appreciate it. We'll make sure to bring our Documentation team's attention to this suggestion.

    Do you have any other specific suggestions or comments that you want us to consider with a very high priority while building up the topics in the Documentation? We would love to hear them.

    Regards,
    Boyan Barnev
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

24 posts, 0 answered