En dev registry listing screens - Hiranyaloka/Documentation GitHub Wiki
Define and set overall behavior for listing screen
At minimum, primary
and default_sort_key
should be specified
- condition
- Specify a subroutine to define if this screen should be displayed in this context. Can be used to check permissions that can not be expressed with simple permit_action string
- contents_label
- A hack used in Entry and Category – will be passed to the template as-is
- contents_label_plural
- Same as contents_label, only in plural form
- default_sort_key
- When opening the screen, the items will be sorted by this key. usually it is simply the id, or modification date, or title. On the screen the user can select to sort by different key
- feed_label
- If there is a RSS feed for these objects, specify feed_label and feed_link and they will be added to the screen
- feed_link
- see feed_label
- object_label
- Name of the object type. used for the filter label / message boxes etc.
- object_label_plural
- Same as object_label, only in plural form
- object_type
- The object type that needed listing. if omitted, the screen ID will be used
- permission
- The permit_action needed for accessing the list.
multiple values should be comma-separated, and the user need to have at least one of them to see the list.
Can also be a hash with “inherit” and “permit_action” keys. In this case “permit_action” is as described above, and “inherit” specify that if this list is in website context, the user can have permission on the website or on any of the website children blogs - primary
- Primary fields to be displayed in wide. 1 multiple value should be written as an array
- scope_mode
-
Specify how to handle the current blog context. Objects should be shown for:
wide This blog / website and all its children this only this blog none all objects, regardless the blog they belong to If blog_id is not supplied, this option is ignored
- screen_label
- Page title
- search_label
- see search_type
- search_type
- if search_apis is defined for this object type, use search_type and search_label to customize the search box shown in this screen
- template
- For rendering the listing using a template other then the default list_common.tmpl
- view
- Specify the scope for this screen. multiple values should be written as an array
listing_screens:
profileevent:
object_label: Profile Events
primary: event
default_sort_key: id
condition: |
sub {
my ($app) = @_;
my $user = $app->user;
return 1 if $user->is_superuser();
return $user->id eq $app->param('author_id');
}
- Lising Framework Overview
- Registry: list_properties
- Registry: system_filters
- Registry: list_actions
- Registry: content_actions
1 Primary fields are displayed in a wide format, and the layout may break if they are hidden. so please set their visibility to “force”, so it won’t be possible to hide them