2

So I 'm trying to override the articles.xml in my administrator folder. I figured out that I could create my own plugin and redirect it to another folder.
So here is what I did:

Creating a custom plugin.php

<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.plugin.plugin');

class plgSystemmyPlugin extends JPlugin{

function onContentPrepareForm($form, $data) {
        jimport('joomla.form.form');
   JForm::addFormPath(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_content/models/forms');
JForm::addFormPath(JPATH_ADMINISTRATOR.'/templates/isis/html/com_content/article');
    }
}
?>

and creating a xml file:

<?xml version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin" group="system">
    <name>Custom Plugin</name>
    <author>Joomla! Project</author>
    <creationDate>November 2005</creationDate>
    <copyright>Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.</copyright>
    <license>GNU General Public License version 2 or later; see LICENSE.txt</license>
    <authorEmail>admin@joomla.org</authorEmail>
    <authorUrl>www.joomla.org</authorUrl>
    <version>3.1.0</version>
    <description>PLG_SEARCH_CATEGORIES_XML_DESCRIPTION</description>
    <files>
        <filename plugin="customplugin">customplugin.php</filename>
        <filename>index.html</filename>
    </files>

</extension>

I tried to install it, but it doesn't work. I have already my xml file in my administrator/templates/isis/html/com_content/article.xml

Can anyone please help me fix this? I don't know how to get it to work, so it reads my custom article.xml instead of the original one.

I have been looking in this thread, but I dont know how to get it to work, I think im doing something wrong. enter link description here

  • The link you are referred is an old discussion (Joomla 1.5). Can you be more detail about what kind of override you are trying to achieve? Do you want to add additional fields when adding a new article? Or maybe something else? – webchun Oct 21 '15 at 3:25
  • Yes i want to create more text fields in my edit.php file, and i have to edit the XML files to. And also the article.php in models folder. :) – Peter Oct 21 '15 at 7:09
1

To add additional custom fields to your article you can create a content plugin by following steps on this article

Or you can install this plugin and learn how to add the custom fields for joomla article from it.

To add custom fields for other component you can follow this documentation

To override the article.xml in the models/forms/ folder you can install this plugin and add your override file in the folder

/administrator/templates/system/forms/com_content/article.xml

for the admin side

and

/templates/system/forms/com_content/article.xml

for the frontend side

  • thank you very much, i used the Joomla XML form plugin and it works like a charm. thanks for that – Peter Oct 22 '15 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.