sivaprasad9394
Occasional Collector

How to get the properties of the sitestore folder?

Hello Team,

How to get the properties value of the 2 check box is checked or not in the Script or Template?

sCRIPT_sITEsTORE.png

Thank you,

Siva

0 Kudos
3 Replies
hoebbel
Crownpeak employee

Dear Siva,

these properties are language specific, so you have to get the folders language specific information:
<pagereffolder>.getFolderLangSpec(<language>)
There you can access the properties with getShowInSiteMap() and isVisible()

That should work within both script- and template- code.

Best regards
Holger

Dear  Hoebbel,

Thank you for your reply and time.

I am able to achieve this by using the below code for the pageRefFolder.

1) I have created a format template and rendered the same in the Standardpage template in Page Template.

DisplayInNavigationMenu:$CMS_VALUE(#global.node.store
.getStoreElement(#global.node.parent.id)
.folderLangSpec(#global.language).isVisible())$
DisplayInSiteMap:$CMS_VALUE(#global.node.store
.getStoreElement(#global.node.parent.id)
.folderLangSpec(#global.language).getShowInSiteMap())$
Result:
DisplayInNavigationMenu:true DisplayInSiteMap:true

Based on the verifying the check boxes selected or not, i have to change the role in the Standardpage templates "Search" Channel, All the FS code should go inside the Search Channel of StandardPage.

2) How to check the root folder is checked(2 checkboxs) or not until top root folder? This need to be check until the last root folder in upwards, If any one of the folder or its root folder value is false, then i will change the role as "some_name" in the "Search" Channel in Page Template "Standardpage".

Check_up_to_root.png

 

 

 

 

 

 

 

 

 

How to get the each parents(up-to root) for the  siteStoreRef and check the properties for each parents up-to root.??

Either for Template code or Script code or Module code?

getParent().png

 

Code 1:

$CMS_SET(set_children, #global.node.getParent().getChildren(#global.node.parent.class))$
$CMS_FOR(for_child, set_children)$

.................

$CMS_VALUE(for_child.getDisplayName(#global.language))$
$CMS_END_FOR$

 

Code 2:

$CMS_SET(navChildren,false)$
$CMS_FOR(folder, #global.node.parent.getChildren(#global.node.parent.class,true))$
$CMS_VALUE(folder.id)$
$CMS_IF(folder.getFolderLangSpec(#global.language).isVisible())$
$CMS_VALUE(folder.id)$
$CMS_SET(navChildren,true)$
$CMS_END_IF$
$CMS_END_FOR$
$CMS_IF(navChildren)$
$-- Child Available --$
$CMS_VALUE(navChildren)$
$CMS_END_IF$

Thanks and Regards,

Siva

0 Kudos

0 Kudos