Create templates with system-asset:local blocks

John's Avatar

John

13 Nov, 2015 10:39 PM

We have a central site that we use to store common templates. When we create a new site we use the templates from the central site. It works really nice to keep things organized when changing a template.

The problem I have right now is that when I create a new site, because of the way or navigation works, I have to create a folder index block for the site itself. Then in the template for some of the outputs I have to set the block to be the folder index block I created for the new site. I'm wondering if there is a way for me to either have a central folder index block that automatically adjust for whatever the current site is, or if there is a way to set the default outputs for the template to use the local folder index block for the current site.

Thanks and hope I did a good job explaining this problem.

  1. 1 Posted by Wing Ming Chan on 14 Nov, 2015 05:59 PM

    Wing Ming Chan's Avatar

    Hi John,

    I don't think that either of your options is possible. For example, if you need a site map, you do need an anchored index block for the site. Non-anchored index blocks can only start indexing from the calling page.

    At Upstate, I use the same approach: centralizing templates, config sets and content types. I use web services to create new sites. Therefore, the setup is automatic.

    I never attach blocks/formats specific to sites (e.g., the index blocks used to generate site maps, menu bars, etc.) to any regions at any level. Instead, they are picked up by indexing, using a global index block.

    I talked about this approach in the presentations of 2013 and 2015. I also documented everything I have been doing in my site. Let me know if you need more information.

    Wing

  2. 2 Posted by John on 16 Nov, 2015 03:29 PM

    John's Avatar

    Hi Wing,

    Thanks for the comment.

    From my understanding, a global index block will only working if it is indexing from the calling page. So to make an index block that indexes from the base folder of a site it has to be attached to the folder in the site.

    Thanks

  3. 3 Posted by Wing Ming Chan on 16 Nov, 2015 03:43 PM

    Wing Ming Chan's Avatar

    Yes and no. You need an anchored index if you want to get information of the entire site or the entire folder. You need a non-anchored index block if you just need to look upward to use ancestors and sideway to use siblings.

    For site information like look-and-feel, general configurations, and so on, I can use what I call configuration blocks to store the information and use the global index block to pick them up. For site map, site-specific menu bar and so on, they are anchored to the site. But still, they are not attached to any region. That's how I can use a single template, a single configuration set, and a single content type to generate multiple sites.
    That is to say, the need for site-specific index blocks (anchored index blocks) and the need to attach them to regions are two different things. You can have the site-specific index blocks without having to attach them anywhere. This is how you can free up your templates and so on, without tying them to any site.

    Wing

  4. Tim closed this discussion on 17 Dec, 2015 07:22 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac