Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • John Radley 12 posts 32 karma points
    Aug 10, 2010 @ 12:48
    John Radley
    0

    For testing purposes, will Umbraco work with Templates only?

    Hi,
    If an install of 4.5.1 for .net3.5 is made with just one blank Document Type and one blank Home page (to avoid the initial waring pages) and then create Templates only with "messages" in the html, should I expect Umbraco to work?

    For the very first template, it does - a template containing a full HTML page.

    However, once I add nested Master pages, moving the body contents in to the child, I cannot get to see the child.
    The saving of the nested templates forces the <@% Master line to be created properly, so you cannot go wrong with that. But in spite of getting the <asp:content and contentplaceholders written correctly, I cannot see any child messages.

    Runway is the only one I can get to work 2 deep, by editing Master and Homepage templates to contain text messages - eg <div>Messsage</div>

    Therefore does Umbraco need to have "pages" using templates before the template generation to work?
    Or is there something else I am missing?

    thanks
    John

  • Sascha Wolter 615 posts 1101 karma points
    Aug 10, 2010 @ 13:41
    Sascha Wolter
    0

    Hi John,

    I am not really sure I understand what you want to achieve here. Let's say you only create one document type in your Umbraco installation and a range of templates (which might be nested). Then I suppose you could allow all the templates to be used with your one document type, create all the pages in the content with this one doc type (obsiously it needs to be able to have itself as child node) and select the temlate you want to use on the individual content nodes. That should work fine, you would have to create all these content nodes though as otherwise Umbraco won't be able to create the urls for all the pages.

    Having said that I can't imagine a scenario where you really want to use only one document type for a (reasonably sized) web site. Having a couple of doc types with alternative templates which the CMS user can select is quite handy from time to time, however I wouldn't go the extreme of only having one doc type alone for structuring purposes (so you can better guide the CMS user to a nicer structure in the CMS).

    As to your last question: yes, there needs to be a content page first before that template can be applied to it. You can use the ?alttemplate=your-alternative-template on an existing node to force it to use another template, but you won't get a url if you don't create a content node.

    Kind regards,
    Sascha

  • John Radley 12 posts 32 karma points
    Aug 10, 2010 @ 16:28
    John Radley
    0

    Hi Sasha,
    Thanks for your time in replying

    I'm trying to understand Umbraco 4.5.1 from first princples. At the moment I cannot get nested Master pages to work, and I don't know whether it's a Bug or me!!
    Of course I am only testing. I don't want to really have a real site like this!
    Somewhere in the docs, there is a comment as to creating a site just using Templates..(but it might have applied to Umbraco prior to v4)..!!!

    So, to ask another way.
    Does Umbraco "process" the nested Master pages, or are they used "as is". Will a nested Master page deep in hierarch at level 3,4 etc, only get processed if a Document Type uses it?

    Do I have to connect a Page, a Document Type and a Template together before Umbraco will process them, even though there is no contribution to the output from the Page and Document Type - because I have got test messages in the templates?

    thanks
    John

  • Sascha Wolter 615 posts 1101 karma points
    Aug 10, 2010 @ 17:25
    Sascha Wolter
    0

    Hi John,

    doc types are basically (at) the heart of Umbraco/your web site, they define

    - types and structure of content pages
    - the fields in the database (metaphorically speaking) and it's data type for each doc type
    - which type can use which template

    That means they are the main piece holding everything together. You can create templates without having a content page or a doc type, yet it will be useless within the Umbraco system if it's not hooked up to a doc type. Umbraco won't render any templates if you haven't created a content node with the template in use for it. So to answer your question: yes, you would have to create all three to get something out of the system, even if you have only test message in the template.

    That said there might be a way around this with a bit tricks. It works pretty much how I described it above. Create one doc type and one content node, e.g. give it the name test. Allow it to have all the templates that you created in the doc type. Then when you go to the page you can add ?alttemplate=your-alternative-template to the Url and render the refered template. If the template has one or more master page they will all get rendered appropriately.

    Hope that helps,
    Sascha

Please Sign in or register to post replies

Write your reply to:

Draft