开发者

Can Joomla's article.xml file be overriden in a template?

I'm working on creating custo开发者_运维技巧m article parameters in Joomla 1.5 and was hacking the file /administrator/components/com_content/models/article.xml. Folks discourage hacking the core files of Joomla and now I'd like to follow good practices.

So how would I override the article.xml file so that my template has its own copy with custom parameters in the Advanced section of the file?


You can override just about anything that comes from the Joomla! Core. Check out this documentation on the Joomla site: http://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core


for 2.5 or 3.x

add the article.xml in your override for com_content/form folder

add this line in edit.php

$this->form->loadFile( dirname(__FILE__) . DIRECTORY_SEPARATOR . "article.xml"); 


If it is like most of the other Open Source Software that I use that has that style of "templating", you should just be able to copy the file exactly as it is in the default template, to your new template and modify it there. Ex:

default/a/b/article.xml -> your_template/a/b/article.xml

I don't do too much Joomla, rather other open source PHP CMS and eComm systems, so I am not positive, but is easy enough to try though.


copy these files:

  • \administrator\components\com_content\views\article\tmpl\edit.php
  • \administrator\components\com_content\models\forms\article.xml

to this location:

  • C:\administrator\templates\isis(yourtemplate)\html\com_content\article

Then edit edit.php and add under Html::_('formbehavior.chosen', 'select'); these 2 lines:

$this->form->reset( true );  
$this->form->loadFile( dirname(__FILE__) . DIRECTORY_SEPARATOR . "article.xml");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜