Alex
Alex

Reputation: 35781

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

I'm working on creating custom 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?

Upvotes: 1

Views: 1875

Answers (4)

Tobs
Tobs

Reputation: 1

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");

Upvotes: -1

Benn
Benn

Reputation: 5013

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"); 

Upvotes: 2

Joel Kinzel
Joel Kinzel

Reputation: 970

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

Upvotes: 2

Addo Solutions
Addo Solutions

Reputation: 1637

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.

Upvotes: 1

Related Questions