|
Date: 4/20/2007 5:41 am · Subject: How is page asset order determined? · Rating: -8
Hi, Sorry if this is a second post, 'something weird' (tm) happened to my first post on this topic... if it is not the second post then ignore my ramblings! I have a workflow activity which is used to create an historical record of some system graphs. The activity retrieves the image of the graph from a specified url and adds it as an article to a specified container. The following code is used to shift the new article to the top of the container: my $object = $container->addChild({ className => 'WebGUI::Asset::Wobject::Article', title => 'VM Stat Graph ' . $today->strftime( '%e %b, %Y' ), menuTitle => $today->strftime( '%e %b, %Y' ), url => $self->get('container') . "/" . lc( $today->strftime( '%d-%b-%Y' ) ), styleTemplateId => $styletemplate->getId, templateId => $template->getId, isHidden => 1, description => "<img src='" . $store->getUrl( $file ) . "' />", });
# Move the item to the top of the list while( $object->promote ) { }
As far as I can determine from the docs, the 'promote' while loop will push the create article to the top rank within the container. The main aim is to have a descending date view of the graphs by pushing any new graph to the top of the page. I had seen this code work when I was testing but it does not seem to work now and on playing about with rank I am not sure what the relationship between asset rank and page display order is. My question (finally) is, what determines the order of asset display on a page? And, how can I manipulate this programmatically. Thanks for any assistance, Kevin
|