How to get list of references in Sitecore PowerShell?

How to get list of references in Sitecore PowerShell?

Note: If you have not updated your Link Database, I recommend to update it before performing below operations using Sitecore Powershell. This command is used to get all the items that refer to the item specified in the command. So, suppose we want to get list of items that refer to our SideContent rendering.

When to throw an error in Sitecore PowerShell?

Throws an error if the item does not exist. Use when Sitecore query: or fast: is required. May return more than 1 item. Use to return an item’s children and grandchildren. Use to create an item based on a specified data template. Use to delete or recycle an item.

How to filter out Item references in Sitecore?

We can use Where-Object to filter out our result set based on TemplateName. We only want to know the names of items created from Event Details Template that refer to our item. This command will return a list of items that the specified item refers to.

Is the / Sitecore part of the path optional?

As you may have noticed, the /sitecore portion of the path is unnecessary. This is because the Sitecore item is represented by the root item of the drive master: and is therefore optional. Let’s have a look at the equivalent code in C#.

Is the link database up to date for Sitecore PowerShell?

One thing to note is that these commands will make use of Link Database, so your Link Database should be up-to-date. Note: If you have not updated your Link Database, I recommend to update it before performing below operations using Sitecore Powershell. This command is used to get all the items that refer to the item specified in the command.

When do you need to know about Item references?

We have seen scenarios where we want to know about Item references. For instance, suppose we want to get a list of items that have SideContent Rendering assigned to their presentation. This is the exact kind of information that we are going to extract using different commands detailed in this post.

How to check what items are linked to home page item?

Let’s check what items are linked to Home Page item: Using -ItemLink will force the Get-ItemReference command to return a list of Links rather than Items where you can find more information about the association between your target item and source item.