Let's put I create a page programmatically (with db_persist) in a template, ordered by weight.

Code: Select all
<cms:template title='Running tests' clonable='1'
  nested_pages='0'
  dynamic_folders='0'
  routable='0'
  order='010'
  >
  <cms:config_list_view orderby='weight'>
      <cms:field 'k_selector_checkbox' />
      <cms:field 'k_page_title' sortable='1' />
      <cms:field 'k_page_date'  sortable='1'/>
      <cms:field 'k_up_down' sortable='1'/>
      <cms:field 'k_actions' />
  </cms:config_list_view>
</cms:template>


Is there an obvious/easy programmatic way to put a created page on the first top-most position? On second position?

Code: Select all
<cms:db_persist _masterpage='test.php' _mode='create'
    _auto_title='1'
    >
    <cms:php>global $DB, $CTX;
    $page_id = $CTX->get('k_last_insert_id');
    </cms:php>
</cms:db_persist>


I have not seen a public discussion about this task or about how weight is regulated. :)