Site Templates
-
- Posts: 21
- Joined: Sun Feb 24, 2019
We are using powershell scripts to correct CSL's post template deployment, working like a charm. We were wondering if we could also correct the Related Items Controls in the same fashion. This is for CSL's and RIC's connected to lists in the same site. The controls function fine if they connect to lists on others sites.
Thanks again!!!
Thanks again!!!
-
- Posts: 21
- Joined: Sun Feb 24, 2019
maybe something like this, we could find each list, loop files with the correct names and update each? I have used this is the past for HTML files in the site and the forms are text files like HTML.
Start-SPAssignment -Global
$web = Get-SPWeb "http://sharepointdev:90"
$list = $web.Lists.TryGetList("Site Pages")
foreach ($file in $list.RootFolder.Files)
{
if ($list.ForceCheckout) { $file.CheckOut() }
$html = [System.Text.Encoding]::ASCII.GetString($file.OpenBinary())
$html = $html.Replace("p", "P")
$file.SaveBinary([System.Text.Encoding]::ASCII.GetBytes($html))
if ($list.ForceCheckout) { $file.CheckIn() }
}
Stop-SPAssignment -Global
Start-SPAssignment -Global
$web = Get-SPWeb "http://sharepointdev:90"
$list = $web.Lists.TryGetList("Site Pages")
foreach ($file in $list.RootFolder.Files)
{
if ($list.ForceCheckout) { $file.CheckOut() }
$html = [System.Text.Encoding]::ASCII.GetString($file.OpenBinary())
$html = $html.Replace("p", "P")
$file.SaveBinary([System.Text.Encoding]::ASCII.GetBytes($html))
if ($list.ForceCheckout) { $file.CheckIn() }
}
Stop-SPAssignment -Global
Office365Guy,
There are no special services to work with Related Items specifically, but you should be able to work with children items/documents with regular Powershell commands.
If you need something specific, could you please provide more details.
There are no special services to work with Related Items specifically, but you should be able to work with children items/documents with regular Powershell commands.
If you need something specific, could you please provide more details.
-
- Posts: 21
- Joined: Sun Feb 24, 2019
This is in reference to creating a site template and repairing the related items that connect to the same site. I found if I open the forms exported .xfds file in Notepad and replaced the few references to the site, like the "SiteRelativeUrl=", then import and save the form the Related items work within the new site. We would like to edit these files live on the SharePoint site instead of exporting, editing, importing and saving to cut time in the process. This idea came from the powershell script that is used to fix the same issue with the Cross Site Lookups.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 7 guests