More in this section

Forums / General Discussions / CSS & MasterPage

CSS & MasterPage

15 posts, 0 answered
  1. Joshua
    Joshua avatar
    10 posts
    Registered:
    18 Mar 2010
    17 Nov 2010
    Link to this post
    Within sitefinity 4.0 beta, am I able to edit the masterpages & create a new css theme? It is a little different than what I am use to with 3.7.

    Thank you,
    Joshua
  2. Tom
    Tom avatar
    37 posts
    Registered:
    26 Apr 2006
    17 Nov 2010
    Link to this post
    Joshua,

    There is an example of how to do this in the 4.0 Beta 2 SDK (http://www.sitefinity.com/4.0/sdk)

    However, I am having problems getting it to apply my CSS when I apply a theme in Sitefinity.

    Tom
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    17 Nov 2010
    Link to this post
    Hello Thomas ,

    The difference is only in the way that templates and themes are registered, but everything else is better than 3.x . You can take a look at our designers guide and SDK.

    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
  4. Tom
    Tom avatar
    37 posts
    Registered:
    26 Apr 2006
    17 Nov 2010
    Link to this post
    I have gone through the example in the SDK for implementing the University theme,but my CSS styles don't render. I used Chrome's developer tools to look at what is going on, and the main.css and Reset.css style sheets are coming up blank. A look at the Request URL, and the reason is because I am receiving a "403 Forbidden" error when the stylesheet is pulled. If I try to go to the style sheet directly in the browser by going to http://localhost:30166/WebsiteTemplateTest/App_Data/Sitefinity/WebsiteTemplates/University/App_Themes/LightGreen/global/main.css

    I do indeed get a 403 error. The path is correct, and I don't see any file permission issues.

    Any idea what could be causing this?

    Thanks,

    Tom
  5. Tom
    Tom avatar
    37 posts
    Registered:
    26 Apr 2006
    18 Nov 2010
    Link to this post

    In the previous post, I commented about getting a "403 Forbidden" error when trying to access the main.css file of the University sample template.  I just realized that the Template is placed under the App_Data folder. Isn't that folder supposed to be restricted so that any content placed in it is not downloadable? This might explain why I can access it. This is by design. But that is where the "HOW TO CREATE A TEMPLATE" document says to put it.

    I am confused. How can it be put there and still be accessible on the web?

     In fact, if I try creating the a master file or a css file anywhere under the App_Data folder in Visual Studio, it is not available as an option. When I created my sample University template, I cheated and added the folders and file from the file system and then included them in the project from within Visual Studio. Had I tried doing it from Visual Studio, I would not have been able to do it.

  6. Neil Mercer
    Neil Mercer avatar
    10 posts
    Registered:
    24 Sep 2009
    18 Nov 2010
    Link to this post
    Hi Tom,

    You're right - the App_Data folder is restricted in IIS7 to prevent access to it from the web.  I ran into the same problem as you - followed the instructions in the SDK documentation, and then discovered I wasn't getting the theme I expected.

    Seems the only solutions are to either a) unprotect the App_Data folder (not a great idea) or b) put the themes somewhere else.  I created a folder called App_Themes and put everything in there.  Then you just have to change the path when registering the theme with the SItefinity backend. 

    Hopefully there will be an official answer at some point, but in the meantime at least my theme is working.

    Cheers,
    Neil.
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Nov 2010
    Link to this post
    Hello,

    App_Data contains application data files including .mdf database files, XML files, and other data store files.App_Data is a storage point for file-based data stores. The App_Data folder is a folder, which your asp.net worker process has files sytem rights, but isn't published through the web server.

    Greetings,
    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
  8. Tom
    Tom avatar
    37 posts
    Registered:
    26 Apr 2006
    18 Nov 2010
    Link to this post
    I understand what the App_Data folder is for, and why the files are inaccessibly.  But, in the example, the main.css and the Rest.css files are in a subdirectory under the App_Date folder, and the browser is trying to access it there (as per Google Developer tools) Either the example is wrong, or I am doing something wrong. Its probably me, but I am not seeing what I did wrong.

    Can you guide me in the right direction?

    Thanks,

    Tom
  9. Tom
    Tom avatar
    37 posts
    Registered:
    26 Apr 2006
    18 Nov 2010
    Link to this post
    Thanks Neil,

    I think your suggestion of putting the themes in a different directory should work. I'll give that a try. I would still like to know why the examples have you put it in the App_Data folder. Surely they tested their own example. They did it this way in the Sitefinity 4.0 Beta 2 documentation when creating the University Template, and in the Sitefinity 4.0 RC documentation when creating the Hospital Theme. The URL for The RC documentation will be out shortly. I posted it in a different post, and they edited the URLs out of my post, so I guess that was not supposed to be out there yet. My bad.
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Nov 2010
    Link to this post
    Hi Thomas ,

    Please refer to the designers guide and SDK. which contain information for the edition you may use. The SDK contains a sample theme which you can use and see the actual implementation.

    Kind 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. Tom
    Tom avatar
    37 posts
    Registered:
    26 Apr 2006
    18 Nov 2010
    Link to this post
    Yes, it was the samples in the SDK that I got my information from, and it has you put the theme under the App_Data folder. I have been through it in detail, and something is not working right.

    Specifically, it was the "How to Create a Website Template. Telerik University" example that I am referencing. I have followed it exactly.

    Thanks
  12. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    18 Nov 2010
    Link to this post
    Hi Thomas Marshall,

    Can you please show us what input you have used for your theme path?

    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
  13. Tom
    Tom avatar
    37 posts
    Registered:
    26 Apr 2006
    18 Nov 2010
    Link to this post
    Under Administration, Settings, Frontend Themes, LightGreen, I entered this for the Path field:
    ~\App_Data\Sitefinity\WebsiteTemplates\University\App_Themes\LightGreen

    If you look at the fourth post from the top, you will see the location that the browser tries to pull the main.css style from which results in a 403-forbidden error if examined via Google developer tools.
  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Nov 2010
    Link to this post
    Hello Thomas ,

    You have to use slashes, not back slashes in the input field.

    Sincerely yours,
    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
  15. Tom
    Tom avatar
    37 posts
    Registered:
    26 Apr 2006
    18 Nov 2010
    Link to this post
    That would explain it.  Thank you so much. I copied the path from file explorer and edited from their, so I never noticed the difference.

    It works now. 

    THANK YOU.
15 posts, 0 answered