I have a portlet that contains references to other porlets, and I was wondering based on an option block if I can hide one of the portlet. I understand that portlet are seeded into the database, but I was wondering if there is way to do that at runtime.
I actually found out how to do it, you can override the read in the SysWorkspaceElement and in the around event check if the optionblock is enabled or not, and manipulate the where clause, would be something like this:
We recommend using a before action instead of an around action. Perhaps better though would be to put your logic in the readable so that you do not have to customize the read. There is an article on using the readable  here.
Hi Owen, so I tried to do in the readable attribute in the SysWorkspaceElement class and didn’t work in the UI, but if I do the read using scheme, works just fine. I attached two screenshots.