I want to create an interactive dialog using PowerShell script
.
I have multiple sites under the same Tenant
if I select any site node in field 1, then field 2 root node should be changed to that site's Data folder. Then the user can select any item under the Data folder.
Scenario:
Tenant A
- SiteA
- SiteA/Data/Form Folder
- SiteB
- SiteB/Data/Form Folder
If user select SiteA in the Field 1, then Field 2 should show SiteA/Data/Form Folder as its starting node.
Edit:
$dialog = Read-Variable -Parameters `
@{ Name = "language"; Title = "Select Language"; Source="DataSource=/sitecore/system/languages"; Editor="droplist"},
@{ Name = "siteNode"; Title = "Select Site"; Source="DataSource=/sitecore/content/Sitecore902&DatabaseName=master&IncludeTemplatesForDisplay=Site"; editor="droplist"} `
-Description "This module is used to import Data." `
-Width 400 -Height 200 `
-Title "Import Utility" `
-OkButtonName "Select" `
-CancelButtonName "Cancel"
if ($dialog -ne "ok")
{
Exit
}
$dialog1 = Read-Variable -Parameters `
@{ Name = "itemPath"; Title = "Select Location"; Root=$siteNode.Paths.FullPath + "/Data/POIs"; Editor="item"} `
-Description "This module is used to import Data." `
-Width 400 -Height 200 `
-Title "Import Utility" `
-OkButtonName "Import" `
-CancelButtonName "Cancel"
if ($dialog1 -ne "ok")
{
Exit
}
In here, I am using two Read-Variable
. As you can see the value of siteNode
is being used in itemPath
. I want all the selections in one dialog box, and the functionality should remain the same. Right now, if I add itemPath
to the $dialog
, it is not working as expected.
Thanks for the help.