Index: openacs-4/packages/acs-content-repository/www/doc/guide/items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-content-repository/www/doc/guide/items.adp,v diff -u -N -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-content-repository/www/doc/guide/items.adp 3 Sep 2021 09:14:41 -0000 1.4.2.1 +++ openacs-4/packages/acs-content-repository/www/doc/guide/items.adp 13 Jul 2023 12:47:28 -0000 1.4.2.2 @@ -12,29 +12,35 @@

Content items are initialized using the content_item.new function. A name is the only parameter required to create an item:

-
item_id := content_item.new( name => 'my_item' );
+
+item_id := content_item.new( name => 'my_item' );
+

The name represents the tail of the URL for that content item. In most cases you will want to create items in a particular context with the repository hierarchy:

-
item_id := content_item.new(
+
+item_id := content_item.new(
    name      => 'my_item', 
    parent_id => :parent_id
-);
+); +

The parent ID must be another content item, or a subclass of content item such as a folder.

The content_item.new function accepts a number of other optional parameters. The standard creation_date, creation_user and creation_ip should be specified for auditing purposes. You can also create the initial revision and publish text items in a single step:

-
item_id := content_item.new(
+
+item_id := content_item.new(
    name      => 'my_item', 
    parent_id => :parent_id,
    title     => 'My Item',
    text      => 'Once upon a time Goldilocks crossed the street.  
                  Here comes a car...uh oh!  The End',
    is_live   => 't'
-);
+); +

If either the title or text are not null, the function will create the first revision of the item. It will also mark the item as live if the is_live parameter is true. The @@ -44,7 +50,9 @@

If a content item has at least one revision, then it can be published by calling the content_item.set_live_revision procedure, which takes as input a revision_id:

-
content_item.set_live_revision( revision_id => :revision_id );
+
+content_item.set_live_revision( revision_id => :revision_id );
+

karlg\@arsdigita.com

Last Modified: $‌Id: items.html,v 1.2 2017/08/07 23:47:47 gustafn