How to create deviating behavior for a single instance of a Template Panel

From Tygron Support wiki
Revision as of 11:46, 30 June 2020 by Rudolf@tygron.nl (talk | contribs) (Created page with "{{stub}} When using a Template Panel, in some circumstances it may be desirable to have a single instance of the Template Panel (or a subset of them) behave different...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This article is a stub.

When using a Template Panel, in some circumstances it may be desirable to have a single instance of the Template Panel (or a subset of them) behave differently than others. For example, when two types of Neighborhoods exist in a [Project]], and depending on whether the Neighborhood is residential or industrial information should be dispalyed which either shows the amount of available housing or the amount of industrial floorspace, in addition to some information which is consistent between both types of Neighborhood.

It will be tempting set up the Template Panel for one type of Neighborhood, apply it, and then replace the content of some of the resulting instances with content befitting the other type of information you wish to display in those instances. This route is not recommended, as when the Template Panel is reapplied, those changes are removed and new instances with content matching that of the Template Panel are created anew. Instead, it is desirable to set up the Template Panel so that it can display information for both types, but dynamically determines which information to display.