Custom Filtering of the Sites List and Map
The Sites page shows a list of all configured site pages in your application. For each of these, sub-sites and I/O are also listed. If you have a mixture of sub-site types and want to control which ones are displayed, or if you want to exclude the I/O, there are some ways in which you can filter the contents of the list.
The list is built automatically. Developers can filter this list for their Context-tag based sites by editing the code for that tag type to add the parameter, CustomSiteListFilterType and set its value to the name of the type or type-group that they want to filter for.
New types derived from Context tags do not count against your VTScada license limit until you add custom code to them, after which every instance of that type will be counted.
If you are writing a site tag from scratch, you can build-in filters for the sites list and for the maps by adding subroutine modules to be used as call-backs.
This must return an array of tag names. If this module exists in your custom tag, then GetSessionContainerTags will call it instead of GetTagList. An example of such a module is provided:
< {================== CustomSiteListGetSubTags =================} {=============================================================} CustomSiteListGetSubTags [ Tags; ] CustomSiteListGetSubTags [ If 1; [ Tags = \GetTagList(Root\Name, Invalid, Invalid, Invalid, "MultiSmart"); Return(Tags); ] ] >
After adding this code, you may want to consider setting your tag's SiteListDisplay parameter. If your subroutine returns a list of I/O, you may want to set the SiteListDisplay to 1 to treat it as a site. if it returns a list of sub-sites or a mixture of sub-sites and I/O, you may want to set SiteListDisplay to 2 to treat it as a folder. If the SiteListDisplay value is not set explicitly, the default behavior may be other than what you prefer.
This module will be similar in structure to CustomSiteListGetSubTags. Two parameters can be provided:
ShowAll is an optional Boolean.
NavigationPath is an optional array of the tag names that were followed (clicked upon by the operator) to arrive at the list being viewed. This parameter can be used if you want to change the filter based on the path taken through the site structure.
< {================== CustomSiteMapGetSubTags ==================} {=============================================================} CustomSiteMapGetSubTags ( ShowAll; NavigationPath; ) Main[ { Your filtering code, returning an array of tag names. } ] >