Fun with Site Studio 10gR4 Placeholders, Part 1
By alan.baer on Mar 13, 2009
In Site Studio 10gR4, a placeholder tag designates a spot where some sort of managed content gets fed into a page template. Placeholders are the 10gR4 Site Studio’s more flexible version of “contribution regions”, which are still supported for backward compatibility.
By default, placeholders allow contributors to assign or create content at that location. But placeholders can also take parameters, which allow you to manipulate them in interesting ways that would have been difficult with previous versions of Site studio. In this post, I’ll introduce two of the key parameters and show some common uses.
One important parameter a placeholder can take is the Content ID of a data file. This is done by adding a dataFileDocName parameter to the placeholder. This parameter tells Site Studio to use a specific data file, rather than looking what data file was assigned by contributors and stored in the project file. In fact, when a data file parameter is put onto a placeholder, the ability for end users to assign content – i.e. create new or reuse content and assign it to this placeholder – is suppressed, because we don’t want to mislead users into thinking that the “switch” action will accomplish anything.
Why would you want to do this?
Consider a footer. You want users to manage and edit the footer, but you don’t want them to have to assign it for every page. So you can reference a specific data file in the placeholder for the footer. That way, the same data file will be used everywhere, but at the same time you still get the in-context editing so users can change it. A placeholder that references a footer might look like:
And the finished footer might look like:
If you want to do the same thing but don't need a backing data file - you simply want to include a chunk of markup or script, optionally with additional placeholders - you can reference a sub template from your placeholder using the templateDocName parameter. A placeholder with a templateDocName reference looks like this, where "RVI_FOOTER" in this case is the dDocName of a sub template rather than a data file:
Upcoming posts will look at how to use placeholders to do personalization and A/B testing, and how to use placeholders to make flexible templates.