Skip to content

Instantly share code, notes, and snippets.

@davidpanzarella
Forked from jsieber/updateattributes.cfm
Last active August 29, 2015 14:08
Show Gist options
  • Save davidpanzarella/d236976ee044c90aabb2 to your computer and use it in GitHub Desktop.
Save davidpanzarella/d236976ee044c90aabb2 to your computer and use it in GitHub Desktop.

Revisions

  1. @jsieber jsieber created this gist Nov 5, 2014.
    26 changes: 26 additions & 0 deletions updateattributes.cfm
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    <cfoutput>
    <!--- Read out an existing node from the default site.--->
    <cfset contentBean=application.contentManager.getActiveContent('59280367-A98E-4F7D-B4463B3E405054FD','default')>
    <!--- Pull out a content iterator of the nodes child content (all underlying pages within a given node).--->
    <cfset it=contentBean.getKidsIterator(liveOnly='false') />
    <!--- The number of Items to be listed is determined by the content.getNextN() value. Its default is 10. --->
    <cfset it.setPage(1)>
    <!--- You can also set the start row instead of setting a page number. --->
    <cfset it.setStartRow(1)>

    <cfloop from="1" to="#it.pageCount()#" index="p">
    <cfset it.setPage(p)>

    <cfloop condition="#it.hasNext()#">
    <cfset childcontentBean = it.next() />
    <cfset childcontentBean.setDisplay(1) />
    <cfset childcontentBean.setisNav(1) />
    <cfset childcontentBean.setsearchExclude(0) />
    <cfset childcontentBean.save() />
    <cfif not structIsEmpty(childContentBean.getErrors())>
    <cfdump var="#childContentBean.getErrors()#"> <br />
    </cfif>
    #childcontentBean.getfilename()# has been turned on!<br />
    </cfloop>
    </cfloop>
    </cfoutput>