Vulnerability in EPiServer.Forms
I am curious what the best way to approach being able to set instance properties on global blocks.
For example, I have a global blocks that render two columns and I would like to be able to set whether the columns are rendered Left-Right or Right-Left for each individual instance of the block. My goal would be to leverage global blocks while not having to create separate versions with the same content just because I want to adjust the layout on specific pages.
So, you have created a block of type "block type x", and you are using that single block on multiple places, but you want to render the block differently on different places?
What/who controls how the block should be rendered? If the editor should control it, it could be a setting on e.g. the page where the block is added. Or, it can be controlled by what page type (or any content type) that renders the block. You could even create a new block type that just contains this setting, and you add your block to that one.Either way you need to pass this setting when the block is rendered.
Let me know if you need help with how to pass the setting from e.g. the page to a block that is rendered in a content area.
It sounds like you want to implement the display options for these layouts https://world.optimizely.com/documentation/developer-guides/CMS/rendering/display-options/ .
These are designed to be able to apply different display layouts to a block without changing the block pages. I would create display options for this 2 layout types, then you can either render different layouts or just adapt layout based on the passed in tag. If you need to control them on a individual block lever I have a solutiion for that https://world.optimizely.com/blogs/scott-reed/dates/2018/4/controlling-episerver-display-options-via-a-custom-attribute/
Ah, yes, dispaly options! Forgot about those, rarely use it. But in this case it may be a good fit.
Thanks for the responses! Display options looks like exactly what I'm looking for and I believe are using for some blocks already so will dig in there.