How to create prevent the creation of a single instance of a Template Panel

From Tygron Support wiki
Jump to navigation Jump to search

Under some circumstances, it may be desirable to use a Template Panel to automatically create Panels for some type of Item, despite there being one or a few of those Items which explicitly should not have a Panel created for them.

It will be tempting set up the Template Panel, apply it, and then remove some of the resulting instances. This route is not recommended, as when the Template Panel is reapplied, all instances of the Template Panel will be created anew, and thus the few instances which should not be present in the Project have to be removed again. Instead, it is desirable to set up the Template Panel so that the Items for which no instance of the Template Panel should be available are filtered out when applying the Template Panel.

How to orevent specific instances of a Template Panel from being created:
  1. Set up the Template Panel as desired, including which Item the Template Panel should apply to.
  2. Add an attribute to each of the Item the Template Panel applies to.
  3. For each Item which the Template Panel should not create an instance, remove the Attribute aded in the previous step.
  4. If done correctly, only the Items which the Template Panel should apply to should have the specifically added Attribute.
  5. Set the Template Panel's Attribute filter to the Attribute added in the previous steps.
  6. Apply the Template Panel.
  7. If done correctly, some of the Items will have an instance of the Template Panel, while specific others do not.