How to change the home page after creating a subsite

  • 10 November 2015
  • 9 replies
  • 3 views

Badge +1

I've got a site workflow which creates a new sub site according to some parameters given.

Now I'm looking for a solution to change the head line of the home page.

Is there any solution available?

thx & br

Chris


9 replies

Badge +7

Hi,

I think the only way to achieve this via workflow is to use a PowerShell action.

https://nintexwfpowershellaction.codeplex.com/

After installing this action, you will be able to set a script as below :

Add-PsSnapin Microsoft.SharePoint.PowerShell  

$w = get-spweb http://mysite.site  

$r = $w.RootFolder  

$r.WelcomePage = "Pages/CustomHome.aspx"  

$r.Update()  

$w.Dispose()

Badge +1

Hi Pierre,

thank you for your idea, but it doesn't meet my question.

I want to update/change the content of the page.

i.e.: <H1>template headline</H1> (as in the site template) should be changed to <H1>{Name of new created Site}</H1>

Badge +7

I read too fast, sorry...

But I think Powershell action still available to your needs.

What's the site template you use?

Is the home page a wiki page or a publishing page?

Badge +1

It’s a WebPart-Page

Mit freundlichen Grüßen // Best regards

Christian Polz

Badge +7

Which template do you use?

I'd like to have a try on it before giving you the script snippet.

Badge +1

Hi,

It’s a custom template based on the team-site template.

The homepage has got a CEWP storing some welcome text, links, contact information, …

Nothing special, but I can’t share the template with you (sry for that).

Mit freundlichen Grüßen // Best regards

Christian Polz

Senior Consultant

Badge +7

Ok, I thought you had to edit a content "property" of the home page.

In fact, you need to edit the content of a webpart in the page.

It's a little bit harder but possible in PowerShell.

Here is a sample which could help you : Dev Help: Alter Content Editor Webpart Content using PowerShell

Badge +16

‌ did you ever find a solution for this?

Badge +1

No, I still have to do this manually. :(

Reply