Can anyone please help by advise?
How this possible to output some information in: /master_pages/html_document.html, but on main site page only?
How this possible to make by [if]...[/if] method?
Can anyone please help by advise?
How this possible to output some information in: /master_pages/html_document.html, but on main site page only?
How this possible to make by [if]...[/if] method?
And I need it on main page http://www.site.com/index only
By method like this:
{if $mainpage}<div>...</div>{/if}
and this info will be on main page but nowhere else...
2. And I have one more question:
- why it's impossible to use {$siteUrl} and {$siteName} in: /master_pages/html_document.html ?
General.html page is a structure template of all pages of your website.
$siteUrl and $sitename are global variables as I said html_document.html is just the structure of all html pages, so in a nutshell it does not understand where to display these variables, you should use them in the general.html file
Mainpage is not a component so you cannot use the if statement and use it as a condition.
What exactly are you trying to display and where on index page?
Okay!
Let's talk simplier...
I want to display some <script>...</script> in <head>...</head>.
But I want this script execute on main page only, but on another site pages - NOT.
P.S. I don't know how to explain more simplier )))
You can take a look at this method how to include static file:
protected function newDocument() { $language = BOL_LanguageService::getInstance()->getCurrent(); $document = new OW_HtmlDocument(); $document->setCharset('UTF-8'); $document->setMime('text/html'); $document->setLanguage($language->getTag());
if ( $language->getRtl() ) { $document->setDirection('rtl'); } else { $document->setDirection('ltr'); }
if ( (bool) OW::getConfig()->getValue('base', 'favicon') ) { $document->setFavicon(OW::getPluginManager()->getPlugin('base')->getUserFilesUrl() . 'favicon.ico'); }
$document->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'jquery.min.js', 'text/javascript', (-100)); $document->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'jquery-migrate.min.js', 'text/javascript', (-100));
//$document->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'json2.js', 'text/javascript', (-99)); $document->addScript(OW::getPluginManager()->getPlugin('base')->getStaticJsUrl() . 'ow.js?' . OW::getConfig()->getValue('base', 'cachedEntitiesPostfix'), 'text/javascript', (-50));
$onloadJs = "OW.bindAutoClicks();OW.bindTips($('body'));";
if ( OW::getUser()->isAuthenticated() ) { $activityUrl = OW::getRouter()->urlFor('BASE_CTRL_User', 'updateActivity'); $onloadJs .= "OW.getPing().addCommand('user_activity_update').start(600000);"; }
$document->addOnloadScript($onloadJs); OW::getEventManager()->bind(OW_EventManager::ON_AFTER_REQUEST_HANDLE, array($this, 'onBeforeDocumentRender'));
return $document; }
As there's index page as it is in Oxwall software.