1

How to get rendering data source location either any one of below,

  • Get items final layout renderings with their data source location
  • Get rendering data source location by specific Rendering folder path. Ex: /sitecore/layout/Renderings/Rendering-folder-path

Expected result:

Rendering    |    DatasourceLocation
------------      ----------------------

{289347-238740-230489} | sitecore/content/datasource-location

I tried with ">Get-Rendering" this doesn't have datasource location property.Below list of properties available

PS master:\>Get-Item /sitecore/content/itempath | Get-Rendering -Datasource "*"

OwnerItemId         : 
OwnerItemPath       : 
Cachable            :
Conditions          :
Datasource          : 
ItemID              : 
MultiVariateTest    :
PersonalizationTest :
Parameters          :
Placeholder         : 
Rules               :
UniqueId            : 
VaryByData          :
VaryByDevice        :
VaryByLogin         :
VaryByParameters    :
VaryByQueryString   :
VaryByUser          :
ClearOnIndexUpdate  :
DynamicProperties

Even i tried below directly try to get rendering properties,

PS master:\>Get-Item /sitecore/layout/Renderings/Group/Navigation/Header

Name                             Children Language Version Id                                     TemplateName
----                             -------- -------- ------- --                                     ------------
RenderingName                           False    en       1       {} Controller rendering

1 Answer 1

5

In this example, the item's FinalLayout contains the renderings.

$defaultLayout = Get-LayoutDevice -Default
$rootItem = Get-Item -Path "master:" -ID "{961563FC-3445-4558-BF3A-06DF06BA6298}"
Get-Rendering -Item $rootItem -Device $defaultLayout -FinalLayout

Example

From here you can filter out renderings that have a Datasource specified. In cases where the value is a GUID rather than a path you can use Get-Item to find out more details.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.