+1-888-365-2779
Try Now
More in this section

Forums / 3.x Pre-release forums (retired) / Cannot edit templates

Cannot edit templates

5 posts, 0 answered
  1. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    19 Jan 2007
    Link to this post
    I don't know if this has been reported or not, but i cannot edit Templates in this version.  When i click the button, it errors out giving me a 404.

    While we're at it, i think you should make a few changes to how templates/master pages work:
    • Currently, the only way to add a template is by uploading it.  I think that if you already have the master page in the right directory, you should have some way to import it as a template without the file again.
    • If you rename the template, the name of the master page doesn't change.  I think the two names should be kept in synch, or alternatively you should have the option of pointing a template to a different master page with a different filename. This way if you rename the master page, you can point your template to the new filename and get things working again.
    • Getting your pages to reference a different master page is difficult.  For example, I renamed one of my master pages.  Now all kinds of pages are referencing a template that no longer works.  Looking at the database, you have the master page file repeated in the PageBase table over and over in a denormalized fashion.    I think you should put templates into their own table, with the ID, name of the template, filename of the master page and any other data about the template.  This way, if anythign needs to change, you only have to go to one place.  So i could change the name of the master page file but all my pages would still be referencing the right master page/template.

    That kind of leads me into a somewhat philosophical discussion.  Allow me to just get up on a soap box for just a minute.  I don't know how many CMS applications i've seen where they have a denormalized data structure.  Its so common and so short sighted.  Denormalization and duplication is almost always bad.  It makes reporting and updating data a painful task.  I suggest that your development team take a step back and start making it a rule not to denormalize their data, both for you own sakes in devleoping and debugging sitefinity, but also for us developers that will be using the product and will have to plug in to the API, make custom modules, write reports or for some reason modify the data by hand.  Its really that important and one of the keystones of good programming techniques.

    That being said, I really think that overall you are headed in the right direciton, both from a user's perspective in the features Sitefinity 3.0 is churning out, and from a development perspective with your use of the Nolics O/R Mapper, support for master pages and other .NET 2.0 features and a new API that we can live with. 

    Thanks,
    Craig

  2. Bob
    Bob avatar
    330 posts
    Registered:
    24 Sep 2012
    19 Jan 2007
    Link to this post
    Hello fregas,

    Please, check if there is a mapping for .template extension in the IIS project. It should reference to the aspnet_isapi.dll and should not check if the file exists.

    You are not required to upload master page in order to create a template for it. After adding the master page to the App_Master folder, you need to restart the application, so the folder is rescanned.

    One master page can have multiple temples. That’s why the names cannot be easily kept in sync. We have some ideas how to improve the UI and behavior though.

    I think you got the wrong impression about normalization. PageBase table contains the common fields for both templates and pages. This is how inheritance is implemented in Nolics. Pages reference Templates by ID in a fully normalized manner. It is true that the MasterPage field creates redundant data for Pages as always the master page specified in the template is considered. This field at the page level is reserved for future use and although it creates redundant data, it won’t hurt the system.

    We do keep data denormalized where necessary to have better flexibility but this does not apply for pages and page templates. For example, it is possible to have content and pages stored in separate databases. This will allow you to share content between multiple sites. Actually, Sitefinity is much more flexible but this will be demonstrated with examples in the near future.

    Kind regards,
    Bob
    the telerik team
  3. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    19 Jan 2007
    Link to this post
    Bob, thanks for your insight. What you said about templates and master pages makes sense and is a lot more flexible.  I was under the impression that templates and master pages were the same thing, but they are not.

    I added the mapping in IIS and that let me edit the template.  Thanks.  Will this work this way for the final version?  Having to map .template in IIS will probably cause you to lose customers for a lot of people on shared hosting and it breaks xcopy style deployment.

    Again, I hope you'll forgive my philosophical rant, but i still think that denormalization is bad, and if anything it promotes a less flexible design, because to make changes often require you to update backup data in your database to multiple places.  Normalization has been around a long time and it has never costed me in terms of flexibility.  There are times that I'll duplicate and denormalize data for reporting or archiving purposes, but the source of that data that gets updated is always normalized. 

    http://en.wikipedia.org/wiki/Don't_repeat_yourself

  4. fregas baratis
    fregas baratis avatar
    185 posts
    Registered:
    14 Nov 2002
    19 Jan 2007
    Link to this post
    Hi Bob,

    I didn't see a way to add a new template in Sitefinity (mabye this is still being worked on) to hook my master page up to the template.  But i was able to see new templates by adding a master page and restarting the service.

    Thanks again for your help.

    Craig
  5. Bob
    Bob avatar
    330 posts
    Registered:
    24 Sep 2012
    22 Jan 2007
    Link to this post
    Hi Craig,

    When you add a master page to the App_Master folder, a page template is crated automatically based on that master page and with the same name. You can multiply this template in the Pages > Templates section by copying. Then you can set different themes and controls for these templates.

    About extension mappings: the project manger will take care for all IIS settings when creating and deploying Sitefinity projects. We still need to do some research and testing for shared hosting. I’m sure we will find solutions for most problems, though some features might be disabled for this type of hosting. As far as I know a lot of shared hosting providers are allowing pretty great degree of control over virtual folders application settings.

    I’d like to say a few more words on the normalization / denormalization subject. This seems to me pretty much like the dispute for strongly typed vs. dynamic languages like Ruby and Python. Almost any major project I’ve seen written in .Net language involves reflection. Trying to make strongly typed language more dynamic comes with overhead in terms of writing and performance and still the code is somewhat safer and much easier to debug. But we can’t do without reflection, can we? The same thing with demoralization, we need to use extra caution when working with denormalized data but that allows us to easily merge data form different sources and if you manipulate the data through the API, you are perfectly safe. A striking example of where normalization is sacrificed for the easy of use is Microsoft’s SqlProfileProvider. I want to specify that we are speaking of denormalization of some forms above 3NF.

    My point is, we should not be extreme in our decisions and use all design patterns and technologies we can take advantage of as wisely as we can.

    Best wishes,
    Bob
    the telerik team
Register for webinar
5 posts, 0 answered