M
M
Mikhail Enikeev2016-07-18 23:59:56
Joomla
Mikhail Enikeev, 2016-07-18 23:59:56

How to display the title of the joomla site through the template settings?

Tell me how to display the site title through the settings of the joomla template. I made the template myself and now I need to write an API function in index.php, but I don’t know which one. in templatedetails xml I created an item where you can specify the site title through the template setting, all that remains is the output function itself, tell me how to do this, thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Kumanin, 2016-07-19
@jackkum

// в начале файла index.php шаблона
$document = JFactory::getDocument();
$title = sprintf(
  "%s :: %s", 
  $this->params->get('title-name-from-xml'),
  $document->getTitle()
);
$document->setTitle($title);

<!-- Этот тэг выводит заголовки, скрипты, стили и прочее -->
<jdoc:include type="head" />

https://github.com/joomla/joomla-cms/blob/staging/...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question