Dirtying Pages

Reviving a reeeeaaaallllly old thread here, but collective knowledge and all…

I have found that folder actions are slightly unique

  1. It appears not all fwFunctions are called from folder actions. For instance, fwBeforePagePublished() is not triggered from a folder action. There may be others.

  2. Pages dirtied by a folder action don’t seem to be truly dirty. (thusly, the reason why I am posting to this thread)

Situation: I created a folder action that, when changed, rightfully dirtied its children. Upon publish, action-files from page/item-level actions were applied to the wrong ‘src’. I found it not related to a particular setting in the folder action (the actual value/type of the folder parameters were irrelevant), but rather a particular set of steps that triggered the behavior.

Solution: fwBeforeStartHTML() is the earliest function triggered by folder actions (and triggered before any genuine page-level instances of the same function). Calling the ‘fwDirtyAllActions()’ method on the pages seems to alleviate the problem.

Example, Folder-Level: (The recursion is not needed when called specifically on a page, but can be used in a fwParameterChanged() test to re-dirty all child folders/pages)

Note: This does NOT dirty the page if the page does not contain any Actions.

function fwBeforeStartHTML(){
	F_dirtyChildrenActions(fwItem);
}

function F_dirtyChildrenActions(item){
	if(item){
		if(item.fwIsPage){
			item.fwDirtyAllActions();
//alert(item+' > dirtied');
		}else if(item.fwIsFolder){
//alert('folder (children): '+item.fwItems.fwLength);
			for(i=0;i<item.fwItems.fwLength;i++){
			//loop through with each of its children
				F_dirtyChildrenActions(item.fwItems[i]);
			}
		}
	}
}

Simply pass in the folder or page via the fwItem object.


actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options