07-27-2023, 12:14 AM
This is probably a fairly unique situation, however I am writing some custom code for myBB. It is essentially a small CMS whereby part of it allows users to define blocks and block areas and fill those block areas with code.
The way I want this to function is that the user creates a block area and then defines its position inside a template. As the user can define any block name they want and place them in any area they want, I am having trouble getting my head around just how to handle this in code.
My thoughts were that I could have the user define a variable in their template named block_blockarea_name, I could then grab that the variable and then parse the name of the variable remove "block_" then use the rest of the name to check for any block that is assigned to that area name. I am trying to do this on a custom page rather than through a plugin itself.
The only other option i have is to have a marker like <block:block_area_name> and use a find and replace on that.
Just wondering if anyone has any ideas or suggestions on a better way to handle this.
The way I want this to function is that the user creates a block area and then defines its position inside a template. As the user can define any block name they want and place them in any area they want, I am having trouble getting my head around just how to handle this in code.
My thoughts were that I could have the user define a variable in their template named block_blockarea_name, I could then grab that the variable and then parse the name of the variable remove "block_" then use the rest of the name to check for any block that is assigned to that area name. I am trying to do this on a custom page rather than through a plugin itself.
The only other option i have is to have a marker like <block:block_area_name> and use a find and replace on that.
Just wondering if anyone has any ideas or suggestions on a better way to handle this.