2.3.2.1.3 Page object commands

The definition of page object contents is made by using a simple programming language which allows you to define its organisation, graphic model and number.

The page object commands are inserted in the “Object program” box. The commands may be used in association with HTML code. Each page object may be formed by various command lines.

When inserted in the “Object program” box, all commands are to be placed in isolation, on a single line, starting from the first column in the box.



All commands start with the word “INSERT” and are always in capitals.

The available commands are:

INSERT article | articles | text
Inserts one or more fixed articles

Parameters:
size – ascertained in terms of pixels or percentage of available space
box – number of one of the box models used in the website
layout – number of one of the layout models used in the website
[columns] – formatting in one or more columns of the comments to view. By default, the formatting is a single column
id | article – id of the article(s) which you intend to insert. Commas may be used as separators if more than one article is to be simultaneously inserted.

The use of bars “/” as separators allows the insertion of an article which will continuously be replaced by those located on the right. The article in the website, at any given moment, is always, from those separated by bars, that starting from the right to the left, that which has a publishing date already in effect. For example, on introducing the parameter id=1/7/50, the articles to be inserted will be 1 until the publishing date of article 7 is reached. In turn, the 7 will be replaced by the 50 as soon as reach the publishing date of the latter is reached.

This command also allows us to link contents contained in other objects based on different Siteseed based projects. It is therefore possible to combine, in a single page, object contents from various databases. The parameters for linking to other objects are:

dbase_server – name or IP of the server where the Siteseed database we intend to access is located.
dbase_project – name of the project we intend to access. In case of doubts as to the name of the project, consult the system administrator you intend to link.
dbase_username – login to access the database. If it is identical to that of your project, this parameter may be omitted.
dbase_password – password to access the database. If it is identical to that of your project, the parameter may be omitted.
Should articles be incorporated from other projects, the box and layout parameters ought to correspond to models that exist within the other project.

[cache] - local|remote|no - defines whether contents are read and saved on the current project cache ('cache=local'), on the cache from a remote database defined by the 'dbase_server' and 'dbase_project' parameters ('cache=remote'), or whether no caching is done at all ('cache=no'), when rendering the page object.

[nolimits] - does not take any value; when present in the command line, 'nolimits' overrides the box, size and column parameters, therefore rendering only the layout-generated contents.


Examples:
INSERT article size = box =3 layout=2 id=3


< br> < i>

INSERT articles size = 100% box=3 layout=2 id=3/6,10,12






INSERT last
Inserts a set of articles chronologically arranging them in accordance with their publishing dates.

Parameters:
howmany – maximum number of articles you intend to insert
skip – allows you to skip the most recent articles
exclude – id of the article or articles you intend to exclude. This parameter is useful if is necessary to combine the INSERT last command with the command INSERT article. For example, to insert an article into a website headline we intend to insert an article with id 5 outlined with the command INSERT article. Immediately after, we intend to insert the ten most recent articles with the command INSERT last. In order for the article with id 5 not to be repeated, as it is included in the ten most recent, we should use parameter exclude=5 in the command INSERT last.
[colums] – formatting of one or more columns of the comments to view. Formatting by default is a single column.
size – measured in pixels or as a percentage of the available space.
box – number of one or more box models used in the website separated by commas.
layout – number of one or more layout models used in the website, separated by commas.
subjects – number of themes where we want to insert articles. If you want to insert articles on differing themes, their respective numbers ought to be separated by commas. (ex: subjects=1,5,7).

This command allows you to link to contents from other projects based on the Siteseed. It is therefore possible to combine contents from many databases into a single page object. The parameters to establish links to other projects are:

dbase_server – name or IP of the server where the Siteseed database to be accessed is located.
dbase_project – name of the project to be accessed. In case of doubt as to the name of the project, consult the respective system administrator.
dbase_username – login to enter the database. If it is identical to that of your project, this parameter can be left out.

Where articles from another project are to be incorporated, the box and layout parameters ought to correspond to models that exist in that project.

[cache] - local|remote|no - defines whether contents are read and saved on the current project cache ('cache=local'), on the cache from a remote database defined by the 'dbase_server' and 'dbase_project' parameters ('cache=remote'), or whether no caching is done at all ('cache=no'), when rendering the page object.

[nolimits] - does not take any value; when present in the command line, 'nolimits' overrides the box, size and column parameters, therefore rendering only the layout-generated contents.


Examples:
INSERT last howmany= 8 exclude=1,3,204 columns=2 size =100% box=4,5 layout=7,8 subjects=1,2,3,4,5




INSERT last howmany=8 skip=2 columns=2 size=100% box=4,5 layout=7,8 subjects=1,2,3,4,5




INSERT set
Inserts a set of articles arranged according to the 'order' parameter and the same parameters used by the 'INSERT last' command.

Parameters:

order - defines the order by which the articles are inserted. Allowed values are:

date [asc|desc] - insert articles by publishing date, ascending or descending.
date_a [asc|desc] - insert articles by approval date, ascending or descending.
date_s [asc|desc] - insert articles by submission date, ascending or descending.
title [asc|desc] - insert articles by title name, ascending or descending.
id [asc|desc] - insert articles by id number, ascending or descending.
random - insert random articles, random order. (for documentation see below)

All the parameters used by the INSERT last command must then be used.

Examples:

This one works exactly as an 'INSERT last' command:

INSERT set order=date desc howmany= 8 exclude=1,3,204 columns=2 size =100% box=4,5 layout=7,8 subjects=1,2,3,4,5

This one inserts articles in the reverse order of the last example:

INSERT set order=date asc howmany= 8 exclude=1,3,204 columns=2 size =100% box=4,5 layout=7,8 subjects=1,2,3,4,5

To insert articles by alphabetical order of their title:

INSERT set order=title asc howmany= 8 exclude=1,3,204 columns=2 size =100% box=4,5 layout=7,8 subjects=1,2,3,4,5





INSERT set order=random

This parameter can be used to select articles randomly. Several parameters can be used to influence the behavior. At first, it is important to distinguish between the use with and without a session. With a session it's possible to memorize what articles have already been shown. This is to assure that all articles have been shown once before starting all over again.

  • Random Feature without session

    There is just one way to use the random feature without a session: A new value for the order parameter of the INSERT set command called random . An example of the usage is shown below:

    INSERT set   order=random   howmany=3 subjects=10

    The command above selects 3 random articles out of all articles classified as subject 10. If there are less articles of the given subject than defined by howmany , only these available ones are shown. This means if there were just 2 articles of subject 10, only these 2 articles would be shown by using the command above.

    All other parameters of the INSERT set command can be used like before. The only difference is the random order. A refresh or a new visit, given that the browser doesn't use its cache, will result in a new random selection. However, it's not guaranteed that successive visits will cause completely different random selections.

  • Random Feature with session

    A session allows to memorize already shown articles. So it is assured that all articles have been showed exactly once, before starting over.

    A session uses a cookie to store a seed and a counter value. The seed determines the order of a random selection explicitly. The counter is used to store what articles have already been shown. At the start of a new session a new seed is created, stored, and never altered. However, the counter is changed (increased) always. But there are parameters to alter that behavior. In order to use random sessions, a JavaScript enabled Browser needs to be used. Otherwise, it exactly behaves like the random feature without sessions (see above).
    • A simple session

      INSERT set order=random session=news howmany =10 subjects=7,9,10

      The command above creates a new session cookie with a seed that stores the random order of all articles of subject 7, 9, and 10. Think about the session parameter like session= sessionname . In this case the session is called “news” and can be identified even on other pages by using this name. Let's assume that there were 51 articles in total of subjects 7, 9, and 10. The above command would show them in 6 fractions using the random order given by the session cookie. Each new visit or refresh results in displaying the next fraction. The first 5 fractions would consist of 10 articles defined by howmany . The remainder is one article, so the last fraction of this session, the 6 th fraction, consists just of this remaining article. After having showed all articles of a session, everything starts over again. The same random order of the articles and fractions is used again, too.
    • A session with notless

      INSERT set order=random session=news notless howmany =10 subjects=7,9,10

      Let's still assume the same example of 51 articles, with howmany =10, and showing just one article as last fraction of the session. In many cases this doesn't look very nicely, in some cases it even may destroy the layout of a page. By using notless it is assured, that the number of articles defined by howmany is always shown. Of course this works only as long as there are more articles available than defined by howmany . In the above example the last fraction is filled with the last 9 articles (that are shown twice) of the fraction before the last one. The above example would not work, if there were just 9 articles available.
    • A session with reseed

      INSERT set order=random session=news reseed howmany =10 subjects=7,9,10

      Once all fractions of a simple session have been showed, it starts over again using the same order of the articles. However, by using reseed it's possible to create a new session seed for every new turn. So once all fractions have been showed it starts over again using a different random order for the articles.
    • A session with expire

      INSERT set order=random session=news expire=60 howmany =10 subjects=7,9,10

      A session cookie expires after 30 minutes of the last page call or refresh. This is a default value. However, by using the expire parameter, one can specify other values as well. The unit of the value is minutes. The above example defines an expiration time of exactly 60 minutes or one hour. A day would be expire=1440. Another way to provide expiration time is using simple mathematical operators as long as there are no additional white spaces. Writing expire=24*60 would be ok, expire=24 * 60 wrong.
    • A session with freeze

      INSERT set order=random session=news freeze howmany =10 subjects=7,9,10

      A session with freeze works exactly like a simple session, except it always shows the same fraction. In case of a new session cookie, this would be always the first fraction.
    • A session with nocookie

      INSERT set order=random session=news nocookie howmany =1 subjects=7,9,10
      INSERT set order=random session=news skip=1 howmany =10 subjects=7,9,10

      Of course sessions wouldn't work without cookies. But if one wants to use the same session for a page several times, the parameter nocookie is needed. This can be necessary to feature an article in a special way or something similar. Only the INSERT set without nocookie writes a cookie and increases the session counter by howmany . If both INSERT sets wrote a cookie, it wouldn't be predictable what cookie (and what session counter value) would survive the other.
    • A session with several parameters

      Of course it's possible to combine these parameters with each other. However, the result of some combinations is sometimes hard to predict. The example below is perfectly fine:

      INSERT set order=random session=front reseed notless expire=100 howmany =5 subjects=7

      All articles of subject 7 are shown in fractions of 7 even if there's a remainder. A new random order would be used after each loop. Session expiration time is set to 100 minutes.
  • Page Caching Issues

    Global Cache

    It should be obvious, that order=random, no matter with or without session, does only work if global cache is disabled . If global cache is enabled, pages using order= random need to be excluded in config.php!

    Headline Cache
    Headline cache should be disabled. If not, it is necessary to include cache=no somewhere in the page object command. E. g.

    e.g.:
    INSERT set   order=random session=ex howmany =3 subjects=7 cache=no






INSERT ticker
Inserts a configurable ticker into the page. In contrast to the remaining “Object program” commands, this can only be called in once per page object.

Parameters:
howmany - how many titles appear in the scroll.
useskin | pageskin – what skin to use in links to articles.
scrollwidth – ticker width in pixels (percentages cannot be used).
bcolor – ticker background colour.
fontsize – font size
skip – how many articles to “ignore”
exclude - ID of the articles to exclude from the list

target – optional target to direct to the frame or new window/popup – optional
usefield – field number to be used (instead of the article title) – optional
subjects – Theme areas to use in extracting the article

Example:
INSERT ticker howmany=10 useskin=[número da skin] bgcolour=CCCCAA scrollwidth=450 lines=3 fontsize=2 skip=0 target =_new usefield=2 subjects=1





INSERT pageticker
Inserts a page ticker into the page. In contrast with the ticker command, contents do not scroll vertically in a box, but are instead displayed as a fully configurable slideshow.
Scrolling of the ticker pages can be put under control by using an INSERT control command in the same page object (see below).

Any number of pagetickers may be inserted in the same page object, and any number of page objects containing pagetickers may be used in the same page.
However, only one control per page object should be used, since it may control any number of pagetickers in that page object, but ONLY in that page object.


Parameters:
width - width of the pageticker (in pixels).
height - height of the pageticker (in pixels).
[clip] - if width and height are set, any text that exceeds the width and height size of the page ticker will try to wrap, but non-wrappable content like images will not show up beyond the pageticker boundaries; if 'clip=no' is set, the whole contents will be shown.
[wait] - time to wait between page displays (in milliseconds). By default it is 2000 milliseconds.
[control] - 'yes' if the pageticker will be controled by a control command in the same page object. Default is 'no'.
[loop] - is set to 'no' the pageticker will not loop back to the first page at the end of the slideshow.
[split] - when 'contents=last' or 'contents=set' is used, it defines the number of articles to be shown per page.

contents - the source of contents for the page ticker. This may be either:

* 'last' or 'set'- Inserts articles, a fixed number of articles per page, which is defined by the 'split' parameter. articles are chronologically arranged by their publishing dates if 'contents=last' is selected, or by whatever is defined by the 'order' parameter, in case 'contents= set' isused.With'contents=last'/'contents=set' the pageticker will take all 'INSERT last'/'INSERT set' command parameters.

Example:
INSERT pageticker width=100 height=50 wait=5000 control=yes contents=last howmany=5 exclude=1,3 columns=2 size=100% box=4 layout=8 subjects=1,2,3,4,5



* a list of article/layout sets or page objects separated by commas. Each comma-separated entity will be displayed sequentially in a different page. The syntax for
article/layout sets is (case insensitive):

A [article id] L [layout id]

If no layout is chosen the default article layout will be used. The syntax for page object calls is (case insensitive):

O[page object id] or H[page object id]

Example:
INSERT pageticker width=100 height=50 wait=5000 control=yes contents=A1,O24,A13L2


For an on-line example click here!




INSERT marquee
Inserts a marquee, in which contents scroll from right to left at a user-defined speed. Any number of marquees may be inserted in the same page object.

Parameters:
width - width of the marquee (in pixels).
height - height of the marquee(in pixels).
[speed] - default is 6. Indicates how many pixels the contents are shifted each time.
contents - the choice of contents is done in a way similar to the page ticker. This may be either:

* 'last' or 'set'

Example:
INSERT marquee width=300 height=50 speed=6 contents=last howmany=5 exclude=1,3 columns=2 size=100% box=4 layout=8 subjects=1,2,3,4,5


* a list of article/layout sets or page objects separated by commas.

Example:
INSERT marquee width=300 height=50 speed=6 contents=A1,O24,A13L2



INSERT control
Inserts a page ticker control into the page. Only one control per page object should be used. However, it will affect all pagetickers in that same page object that have a 'control=yes' parameter. The control may be used to pause the slideshow or to navigate to the next or previous page in the pageticker without stopping the slideshow.

Parameters:
[box] – number of one of the box models used in the website
layout – number of a layout model that contains pageticker control macros.
[nolimits] - overrides the box parameter and no default box is used.

Example:
INSERT control box=2 layout=10



To create a new control layout model in the layout editor, a set of links should be used in which the reference should be any of the three control macros, $pageticker_prev$, $pageticker_pause$ or $pageticker_next$.

Example (in the layout editor):
<A HREF='$pageticker_prev$'>Previous Page</A>
<A HREF='$pageticker_pause$'>Pause</A>
<A HREF='$pageticker_next$'>Next Page</A>






INSERT form
Inserts a form in the page object

Parameters:
Id – id of the form model to be used

nolimits - does not take any value; when 'nolimits' is present in the command line, the form is no longer enclosed in a table.

Example:
INSERT form id=2


INSERT comments
Inserts comments associated to an article

Parameters
article – id of the article to which the comments correspond.
howmany – maximum number of viewed comments.
[columns] – formatting in one or more columns of the comments to be viewed. Formatting by default is one column.
box – number of one, or more, box models used in the website. We may choose many box models, separated by commas. The box models will be used according to the ascribed order, for the first comment, second, etc.
layout – layout model number used for comments in the website.
size – measured in pixels or in percentages of the available space.
[approved] – Insertion of all comments (aprovados=não) or just the already approved comments (aprovados=sim). By default, the already approved comments will be inserted.
br – insertion of a blank line between comments.

nolimits - does not take any value; when present in the command line, 'nolimits' overrides the box, size and column parameters, therefore rendering only the layout-generated comments.

Examples:
INSERT comments article=15 howmany=12 columns=6 box=1,2,2,2,2,1 size=100 % approved=no br=no

INSERT comments article=15 howmany=20 columns=5 box=1 layout=5 size=100% approved=yes br=no





PreviousNext