html
folder, for example, to the root of the site (or not to the root), prepare an empty database and go to the browser at XARAYA_HOME/install.php
. The installer will guide you through the whole process and soon you will have a working site (do not forget to delete the install.php
and upgrade.php
after that.XARAYA_HOME
is something like mybestsite.ru
mybestsite.ru
) XARAYA_HOME/index.php?module=articles&type=admin&func=pubtypes
.themes
folder. Management is carried out through XARAYA_HOME/index.php?module=themes&type=admin&func=list
. You may notice that the RSS and the “print version” are also made through themes, which makes it easier to edit the output for different “devices”.xartemplates
folder of the corresponding module. The search is carried out by the name of the template . For example, trying to display a blog entry ( articles
module, news
publication type, display type - display
), Xaraya will first look in the /themes/YOUR_THEME/modules/ articles
folder and look for the user-display-news.xt
file there. If it does not find it, take the standard one from the delivery (/ /modules/articles/xartemplates/user-display-news.xd
). Thus cascading is ensured - you will have to rewrite only those templates that do not suit you in the standard representation./themes/YOUR_THEME/pages
folder. There are three main ones:default.xt
- for everything about everything,frontpage.xt
- display of the main page, andmodule.xt
- displaying the contents of a specific module (used less frequently).default.xt
file: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE blocklayout PUBLIC "-//XAR//DTD BL 1.0 Strict//EN" "http://xaraya.com/bl1/DTD/bl1-strict.dtd"> <?xar type="page" ?> <xar:blocklayout version="1.0" content="text/html" xmlns:xar="http://xaraya.com/2004/blocklayout" dtd="xhtml1-strict"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <xar:set name="topnavblocksgroup"><xar:blockgroup name="topnav" id="topnav" /></xar:set> <xar:set name="rightblocksgroup"><xar:blockgroup name="right" id="right" /></xar:set> <xar:set name="leftblocksgroup"><xar:blockgroup name="left" id="left" /></xar:set> <xar:set name="centerblocksgroup"><xar:blockgroup name="center" id="center" /></xar:set> <xar:set name="themedir">#xarTplGetThemeDir()#</xar:set> <xar:set name="sitename"><xar:var scope="module" module="themes" name="SiteName" /></xar:set> <xar:template file="headtagcontent" type="theme" /> </head> <body> <div id="xc-outer-wrapper"> <xar:if condition="!empty($topnavblocksgroup)"> <xar:var name="topnavblocksgroup" /> </xar:if> <xar:template file="pageheader" type="theme" /> <xar:template file="pageblockgroups" type="theme" /> <xar:template file="pagefooter" type="theme" /> </div> <xar:base-render-javascript position="body" /> </body> </html> </xar:blocklayout>
xar:blockgroup name="*" id="*"
). The variables and functions of the controller can be accessed through the #PHP_CODE#
construct. Variables are transferred from the controller, which lies in /modules/MODULE_NAME/xaruser
. The model is located in /modules/MODULE_NAME/xaruserapi
. In Xaraya, almost everything is organized through naming conventions; for example, the output controller of a separate publication lives in / /modules/articles/xaruser/display.php
/ articles_user_display($args)
/modules/articles/xaruser/display.php
, in the articles_user_display($args)
function articles_user_display($args)
and transmits the data to the template like this ( $data
and $template
, of course, prepared in the function code itself): return xarTplModule('articles', 'user', 'display', $data, $template);
XARAYA_HOME/index.php?module=themes&type=admin&func=modifyconfig
( XARAYA_HOME/index.php?module=themes&type=admin&func=modifyconfig
). By the way, the CNC can be separately enabled for each module in the settings, and the Russian localization can be downloaded and unpacked into the /var/locales/
folder. <xar:template file="user-display-title" type="module"/> <xar:if condition="!empty($data['summary'])"> <div class="summary">#$data['summary']#</div> </xar:if> <xar:if condition="!empty($data['body'])"> <div class="body">#$data['body']#</div> </xar:if> <xar:if condition="!empty($data['notes'])"> <div class="notes"><p><em>#$data['notes']#</em></p></div> </xar:if> <xar:block module="base" type="html" instance="disqus" /> <xar:if condition="!empty($data['hooks'])"> <xar:foreach in="$data['hooks']" key="$hookmodule"> <xar:if condition="!empty($data['hooks'][$hookmodule])"> <xar:template file="schild" type="module" subdata="array( 'contentfile'=>'prevart-hooks', 'hookmodule'=>$hookmodule, 'data'=>$data )" /> </xar:if> </xar:foreach> </xar:if>
articles
module does not know anything about the tags). Here is what it looks like as a result:Source: https://habr.com/ru/post/115052/
All Articles