You would have to use variables, depending on the page, and use a default (random, in this case) for all pages that don't have a special setting.
So, this is the default, as quoted in the help page:
<?php displayNewsItems(
$group_id = 0,
$max_news_items = 10,
$max_news_lenght = -1,
$display_mode = 1,
$lang_id = 'auto',
$strip_tags = true,
$allowed_tags = '<p><a><img>',
$custom_placeholder = false,
$sort_by = 1,
$sort_order = 1,
$not_older_than = 0
);
?>
For "3 random News from all groups" you need to set $group_id to 0, $max_news_items to 3 and $sort_by to 4.
Now let's say that this is the default for all pages with no special settings, but on page "About", you would like to see 3 random News from Group 5. Let's assume that the "About" page has the ID 55.
<?php
$this_group_id = 0;
if ( PAGE_ID == 55 ) {
$this_group_id = 5;
}
displayNewsItems(
$group_id = $this_group_id,
$max_news_items = 3,
$max_news_lenght = -1,
$display_mode = 1,
$lang_id = 'auto',
$strip_tags = true,
$allowed_tags = '<p><a><img>',
$custom_placeholder = false,
$sort_by = 4,
$sort_order = 1,
$not_older_than = 0
);
?>
If you have lot's of pages with different settings, it will be easier to use an array instead.
<?php
$map_page_to_group = array(
55 => 5,
66 => 6,
);
$this_group_id = isset( $map_page_to_group[PAGE_ID] ) ? $map_page_to_group[PAGE_ID] : 0;
displayNewsItems(
$group_id = $this_group_id,
$max_news_items = 3,
$max_news_lenght = -1,
$display_mode = 1,
$lang_id = 'auto',
$strip_tags = true,
$allowed_tags = '<p><a><img>',
$custom_placeholder = false,
$sort_by = 4,
$sort_order = 1,
$not_older_than = 0
);
?>
Edit: Put this code into your index.php.