All » Articles » Web related (7)
All » Articles » Xaraya (4)

Xaraya setup of this site

Posted by: Ferenc Veres on August 28, 2005 08:08:59 PM +00:00(132183 Reads)

This is an detailed description of this site's Xaraya configuration. The article describes basic configuration and some advanced solutions as well. If you want to achieve something similar in your Xaraya and you need help, feel free to contact me.

This Xaraya installation uses the Articles module for managing content, hooked with Categories to arrange information, and with Dynamic Data for extra data fields.

In depth description of the used Xaraya configuration follows, feel free to take any ideas from them, and please let me know if you know a better way to achieve the same. All important template files are directly linked, if you want to take a look in more, just guess the URL.

Publication types and their templates

These news articles are created as News documents with the original News publication type. The references and free software activities are stored in the Docs pubtype. The only thing I changed in these pubtypes is the use of TinyMCE GUI Area instead the original Textarea for editing (Articles -> Publication types -> Edit).

The Random Quotes pubtype is used on the front page for Daily Tips.

I've created 2 new pubtypes for managing Photos and Screenshots. Currently they use the Uploads module for handling the images. All Screenshots are arranged into specific categories for each referenced software. This way, the summary page of the Screenshots pubtype can display all screenshots of the given program (example). (Note the link back to the article of this screenshot collection, see Categores section below for information.)

There is no link to display the screenshots individually, because that would display no additional information. The order of the items on the summary page is specified by letters in the Notes field of the screenshot (the pubtype is configured to sort by Notes), this way I can customize the order of the images.

The Commodore Books database uses another pubtype, which contains all relevant data of the books, like title, author, ISBN number etc. (example). Their display template (modules/articles/user-display-books.xt) uses a little str_replace function to create space-less ISBN numbers to link to the Mokka book database. This publication type uses a custom page template, see below.

Categories

The Docs pubtype has a category tree similar to the structure of the main menu. Screenshots and Docs share the "Screenshots" category tree (Docs use 2 category roots), thus the screenshots linked together by putting in the same category can also be assigned to a document. This way modules/articles/user-view-screenshots.xt can find its parent article, and create a "back" link from the screenshots based on category linking.

Page layouts and their templates

The front page uses the "base" module, just like in a basic Xaraya install. This way the pages/base.xt can be used to customize the look. I've added the right blocks group to this template only. The modules/base/user-main.xt is empty (in original install it contains the "Welcome to Xaraya" message, but editing a template as content is not a good idea for the long run). The 2 main articles (the top of the front page content area and between the left and right columns) are added to the base.xt as separated blockgroups (frontpage1 & frontpage2 groups, each containing a base/html block).

Other normal page layouts are defined by the pages/default.xt (2 columns: menu and content area), including this article and most of the pages, while the Screenshots and Photos page uses a simplified template without the large menu. These two pubtypes are configured to use pages/articles-screenshots.xt, which contains a reduced menu, to avoid left-right scrolling on smaller browser windows. The only links in this mini menu are Home and a link back to the article which refers to the given group of Screenshots (see Categories above).

The Books pubtype uses a completely different page layout, defined in pages/articles-books.xt. Note that using these articles-[pubtype] page templates is not automatic, you must manually configure the pubtype to use them. This page displays on white background, thus the stylesheet required a "trick" to invert all the text colors: The books page layout uses a different wrapper div class, and the stylesheet defines all important elements to be black if used inside that div. This layout contains an additional blockgroup for the little search field.

The books' front page uses the XarPages module do define a special page with a little introduction (in a base/html block) and some featured books. For this, I've created a page type in XarPages called "booksmain", then I created a page with the same name and configured it to register this name as Short URL module alias. I've set this xarpages page to use the above mentioned pages/articles-books.xt as page template. This way the URL /booksmain uses the usual books layout, but the module content area is defined in modules/xarpages/page-booksmain.xt. This template contains the "booksmain" blockgroup (the intro text alone for now), and some in-template logic to query Dynamic Data and Articles modules for books which have their quantity field set to more than one (the books I am about to trade for others what I don't have).

SSL Login

Update-06/2008: due to server changes, this is currently not in use, please ignore the actual exmaples. The idea described here is still valid and possible.

I was not satisfied with the plain text login for administering my site, thus I modified a few templates to make it SSL at least when sending the password (form action="https:..."). To achieve this, I created a XarPages page (as described above for booksmain) which displays a little login block using modules/xarpages/page-loginssl.xt. This xarpage page registers the /login short URL and displays with the usual page template. The displayed login block uses the default login block override template in modules/roles/blocks/login.xt, where I've added a little str_replace call to change http:// into https:// in the form action field.

Switching system language by pubtypes

The Books pubtype should run Xaraya using the hu_HU system locale, because all content is Hungarian in it. Other parts of the site should run Xaraya in English. For this I use a very ugly and lame hack in all page templates: switch user language to Hungarian when using the Books pages' page layout, otherwise switch to English. (See any of the page templates above, e.g. pages/base.xt.) The little condition checks the current setting and changes it only if necessary.

The only problem with this is that you will see the first page in wrong language, because these template tags are interpreted way after initializing the Xaraya multilingual system (MLS). A redirection to the current URL would fix this problem, but would end session-less browsers in endless loop.

Blocks and blockgroups

Note, that I referred to a lot of blocks in this description. In the templates I always used blockgroup calls, created the groups in the Blocks module and added the necessary blocks to them (even if only one). This makes them easier to edit from the GUI. I haven't mentioned all the blockgroup names and block names above, I think all readers will find the Blocks module very easy to use.

There are no comments attached to this item, be the first to post.

(required)

(required but not published)

About me

Photo of me Ferenc Veres
web developer
about me

Commodore books
Commodore logo My C64 and Plus/4 book collection (Hungarian): Commodore könyvek
Featured article

Exisitng editors for text data DjVu files are quite limited, like for example DjVuSmooth. So I've implemented a new editor in JavaScript, that allows editing both the strucutre of the text (paragraphs, lines, words,...) and the coordinates of the text boxes by simply dragging with the mouse, features like create, delete, merge are also available.

My other websites
Categories
My hosting choice

My affiliate link to the hosting center:

InterServer Web Hosting and VPS