How to add a node to all sites?

Showing results for 
Search instead for 
Did you mean: 
Member II

How to add a node to all sites?

Hi fellow devs,

What is the easiest way to create a node in all sites?

I'm aware of how to create nodes:!/nodes/createNode

And how to get all sites:!/sites/listSites

But a bit lost in what is the best way to connect both in order to create a node for all sites...

Any advice you can give?

Thanks for you time Smiley Happy

2 Replies

Re: How to add a node to all sites?

There is no ootb way to create a node in all available sites in repository at same time. 

If the node is meant to be shared, you should created in "Shared Files". 

If you still need to create the node in each and every available site, then implement a behavior which listens to node creation event, find the available sites before node creation and then loop through all sites and create the node.

Refer this post for more on implementing behaviors:

Helpful in getting all sites or getting sites based on current user who is logged in via SiteService:

NodeCreation via node service:

(ACSCE, AWS SAA, Azure Admin)
Member II

Re: How to add a node to all sites?

Many thanks for the feedback  , currently trying to implement the advised solution.
After it will give my feedback how it was implemented.
In this case the folder is not supposed to be shared so I will focus on the other option.
And also thanks for reminding about the node creation event, it will be quite cool if this can be dynamic, in the sense that once the user creates a new node the folder is there.

Cheers, ARamos