Hi @Jyo234678
Why don't you use datasource for dropdown options, there you can easily identify the resourceType/Template and control the options.
Examples
https://github.com/arunpatidar02/aemaacs-aemlab/blob/master/core/src/main/java/com/community/aemlab/oneweb/core/servlets/ds/ContentTypeDropdownD...