Xaraya UserAPI Functions
Developing websites with Xaraya’s default set of module blocks is rather limited. Use Xaraya’s UserAPI functions for more flexibility.
Most Xaraya modules provide a set of user functions within the modules’ userapi folders. A module’s available blocks use these functions to provide some default functionality, but the blocks are often limited and can only be configured and used based on a set of pre-defined criteria.
If you wanted to place, say, the five most recent articles, spanning all of your configured pubtypes, somewhere on your website’s home page, you could setup an articles block from within the blocks module, sort the articles based on publication date, assign it to a group, and then call it in the page this way:
<xar:block instance="name" type="topitems" />
This works fine and is nicely functional, but what happens when down the road you have several publication types and multiple blocks for each one. It can be difficult identifying which block to place and where to place it.
Another solution is to use the same <xar:block/> tag and place a block directly without having to set one up in the configuration screens. The code below will place a block directly where you need it, and you don’t have to pre-configure it first as in the example above. Just make sure you have the right templates, center.xt for the ... Read More >





