I am using SXA 1.8.0 with Sitecore 9.0.2 on multisite solution. I have a branch template for a page template which creates a few renderings data sources underneath this page, like that:
Page Data Rendering 1 Rendering 2 Rendering 3
The current solution architecture does not allow me to bind these renderings on the page partial designs and they need to be added to the placeholders on the page directly. I am trying to find the best way to do it hence this question.
I think about writing PowerShell scripts to bind these items to the suitable placeholders and maybe add the script in the scaffolding so it will be invoked every time after the item creation (similar to the site/tenant creation).
The issue I see here is that I am not sure how I can actually obtain the current context item in this case in PS without giving the root explicitly so I will be able to get the page item in whatever site it has been created. Also, I do not know if this is really possible to add these scripts to the branch as scaffolding. Maybe writing a script targetting every item of particular page template and going through the CMS tree recursively would be a better option in here?
Do you have any ideas about how this could be done in the easiest way?