Containers

Chris ROth (sent by Nabble.com) wrote:
> <!--- permanent childlinks container --->
> <con:container label="#stobj.objectID#_childlinks"
> defaultMirrorLabel="Landing Page Child Links">
>
> I now have a Landing Page Childlinks container displayed under content -
> content utlitites - shared containers to which I have applied the default
> supplied child links rule.
>
> some ?'s
>
> 1. just by adding: <con:container label="#stobj.objectID#_childlinks"
> defaultMirrorLabel="Landing Page Child Links"> to a display method, the
> container shows up in the admin.. How?

Containers are magical.

In fact you have two containers. The system does the following when it hits a container tag:

  • a look up to see if there is a container matching the mirrorlabel
  • if not, it creates a blank one
  • a look up to see if there is a container that matches the label
  • if not, it creates a blank one and assigns the mirrored/reflected container

Obviously if there is a container found, it executes the contents of the container.

> 2. If I use the admin to add a shared container, how do I know the syntax to
> call it from a displaymethod? ie... if I add a shared container in admin
> called 'mysharedcontainer' I am not clear on the relationship of containerid
> (viewable in status bar mousing over one in the admin, and con:container
> lable="".. I see its obvoius the mirror label is the container's title.
>
> I guess I am looking for some type of leg bone connected to the knee bone,
> knee bone connected to the hip bone...

I think you might be looking at how you assign the properties from a shared library of containers to a magical container on a page you have created. There is no programmatic relationship here – you would open up the page in "design mode" and schedule that shared container content through the "Reflection" tab.

The label/mirrorlabel values in the code are to faciliate the creation of new containers, and specifically the label attribute ties that container to a specific page level container object in the database. The actual container content is something you have to get in place by content editing.

> 3. How is a given containers available display method determined (in the
> drop down). In my examples above I can choose b.h3 level heading inside a
> "featurebox" (which is: dmHTML\displayTeaserTypeB.cfm ... how do I make
> TypeA ALSO available.

Ok so containers contain "publishing rules". You chose a publishing rule to schedule into the container, they are all different – the systems ships with a bunch, you can download other peoples, or write your own.

For core rules (ie. the ones that ship with the installation), the teaser drop down is determined by those content templates prefixed by displayTeaser* in the relevant .webskin/typename folder.

ChildLinks Rule is a little bit special in that it tries to publish HTML, Included Objects and Links in a list of child links. In order to maintain a sense of uniformity it insists that each of these content types has the same teaser display. That is, ./webskin/dmhtml, ./webskin/dminclude and ./webskin/dmlink all need to have displayTeaserTypeX.cfm in order for the option to show.

> Once I understand all that, what I want to do is have a display method
> "Landing" page, that basically has a body then uses containers to show the
> child links as it does not.. but then I'd like that container to display the
> child links of the objects its displaying..
>
> ie...
> My Landing Page
> Welcome to this landing page.. blah blah.
> container: get child links, display the teasers..
> - THEN under each teaser, show teasers for thier children...
> Footer.

So to do this you could use the standard child links rule. You just need to create a teaser that shows the child title, and its own childrens titles. You then need to repeat the process for dmInclude and dmLink.

If you are never going to use dmInclude and dmLink in this capacity don't worry.. you just need the file to exist – it doesn't need anything in it. Of course if the child link rule seems a little stuffy.. you can write a completely new one from scratch.

Hope that helps,

– geoff http://www.daemon.com.au/