I have a requirement to fetch the linked item from its linked sub item along with some linked item from the parent item's field. Below is the scenario.
I have a "Landing Page" In the "Landing Page", I have a field called "List", In the "List" field, I have linked one page called "Main List". In the Main List page, I have a field called "childrens", In the childrens field, I have linked few pages, I want to get these pages in my scriban along with some other items field value. Am facing difficulties getting the linked items from sub-item.
Below is the code I am trying with. Any suggestions and guidance would be thankful in advance.
{{
myList = i_item["List"]
$consolidatedItems = []
for eachLinkedItem in (sc_followmany i_item "Pages")
$consolidatedItems = $consolidatedItems | array.add (eachLinkedItem)
end
$consolidatedItems = $consolidatedItems | array.add (myList["children's"])
}}
{{$consolidatedItems | array.size}}
<br>
{{for i_item in $consolidatedItems}}
{{i_item.path}}<br>
{{end}}