Various view types and their usage
Contents
FAQ: What are the different kinds of Views on the Admin->Views page?
Normally you will want either a Item listing, Full text or Static Page view.
- <a href="http://actionapps.org/faq/detail.shtml?x=1678">Item Listing </a> - these are used like the main Index view to generate a list of some or all the items in a slice.
- <a href="http://actionapps.org/faq/detail.shtml?x=1741">Fulltext View </a> - these
are used to display a single item.
- Item
Digest
- not sure what these are. - <a href="http://actionapps.org/faq/detail.shtml?x=1746">Discussion</a> - used for
creating discussions
- View of Constants - used to display
list of constants (ie. categories).
- <a href="http://actionapps.org/faq/detail.shtml?x=1705">RSS Exchange </a> - used
to exchange items with Content Management Systems that use this standard
- <a href="http://actionapps.org/faq/detail.shtml?x=1739">Static Page </a> - these
are a bit like macros, they are not related to a specific item or slice, but can be used where the same content, or parameterised content is needed on many pages.
- <a href="http://actionapps.org/faq/detail.shtml?x=1735">Javascript item
exchange
</a> - used to view items on a site without AA installed. - URL Listing - special view used mainly for creating list of links to all articles in the slice, which is used for search robots and fulltext indexers like Google, HtDig or MnoGoSearch. It is very similar to <a href="http://actionapps.org/faq/detail.shtml?x=1678">Item Listing</a>, but
you can use just very limited set of fields and aliases, so there is no problem with "memory limit".
- <a href="http://actionapps.org/faq/detail.shtml?x=1715">Calendar view </a>is a
complex view used for showing event items within a monthly calendar.
-
resources to document Links module.
Link listing and Category listing views are used for Links module - you can customize the design of links listing and category listing just like jot normal AA items. The usage is analogous to Item listing and is quite simple, but deep documentation of those views wait for someone, who will have
</div>
Static View
FAQ: What is a Static View and how do I use it
Static Views are a bit like macros, they are not related to a specific item
or slice, but can be used where the same content, or parameterised content is
needed on many pages.
It is a view that only has one format - the 'Odd Row' format. It does not lookup
the values for any items or fields, but just prints the 'Odd Row format'.
However they can take <a href="http://actionapps.org/faq/detail.shtml?x=1738">parameters from the URL</a>
Calendar View
FAQ: How to create a Calendar
The AA now enable to create a Calendar. Events lasting for several days are supported, repeating events are not supported.
Usually three parts of a calendar view are needed. First, a table showing the days and perhaps some caption of events which happen. This is prepared by the calendar view type. Second, some select boxes to choose the year and the month. Prepare these in a .php3 page. Third, a list of events to be shown after clicking on a date. This may be done by a list view with the conditions set as explained further.
To put the view and the caption together, use a .shtml page --- an example of a very simple one is in doc/script/calendar.php3.
Calendar view
Create it by Admin - Views - Calendar - New. Two calendar types are available: Month List shows a month with days in one list under each other, Month Table shows a table with one row for each week. Some new aliases are defined:
_#CV_NUM_D
is the number of the day (to be used in a day cell)_#CV_NUM_M
is the number of the month (to be used in a day cell, usually in an URL link)_#CV_NUM_Y
is the number of the year (to be used in a day cell, usually in an URL link)_#CV_TST_1
time stamp of the current day at 0:00 (to be used in a condition)_#CV_TST_2
time stamp of the next day at 0:00 (to be used in a condition)
New parameters to the view command are introduced: month and year. E.g.
set[301]=month-3&year-2002
The view setting are as follows:
- Top HTML code must contain the
</code> tag and may contain e.g. a table row with names of week days (Mon,Tue,...).
- Bottom HTML code must contain the
</table>
tag.- Additional attribs to the TD event tag may e.g. set a background color to each event. If the alias
_#COLOR___
contains a color, writebgcolor=_#COLOR___
- Event format is the code for the Event description.
- Start date field contains the event start date (must be filled!).
- End date field contains the event end date (must be filled!).
- Day cell top format For "Month List" calendar type it must begin with a
tag. It contains a table cell tag with the day number, usually linked to an daily event list, e.g.
<A href="calendar.shtml?vid=319&cmd[319]=c-1-_#CV_TST_2-2-_#CV_TST_1&month=_#CV_NUM_M&year=_#CV_NUM_Y&day=_#CV_NUM_D">_#CV_NUM_D</A>
The view settings
cmd[319]=c-1-_#CV_TST_2-2-_#CV_TST_1
involve appropriate settings in the list view (no. 319 in my case) - see further. Themonth=_#CV_NUM_M&year=_#CV_NUM_Y&day=_#CV_NUM_D
variables are used in the .php3 page to show the appropriate date - see the example in doc/example/calendar.php3- Day cell bottom format for "Month List" it must end with
</tr>
- Empty day cell top format usually the same as Day cell top format, but without the link to the event list
- Condition 1,2,3 you may use conditions with the calendar, e.g. to view only events of some type
</ul>
Year and month selectboxes
These may be created by a .php3 script. An example of one is in doc/script/calendar.php3. The script is commented
List of events
An ordinary view of the type "Item listing" will do. You must set two conditions. The first condition must be
The conditions are controlled by the command"Start date <"
whereStart date
is the name of the field containing event start date, the second must be"End date >="
whereEnd date
is the name of the field containing event end date.
cmd[319]=c-1-_#CV_TST_2-2-_#CV_TST_1
described above. - Bottom HTML code must contain the