0

I am trying to create a custom component in my Joomla backend, so I created this xml file:

<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.8.1" method="upgrade">
<name>administratie</name>
<creationDate>2019-04-09</creationDate>
<author>Twan</author>
<authorEmail>[email protected]</authorEmail>
<version>3.8.1</version>
<description>Administratie dashboard</description>
<administration>
<menu>administratie</menu>

<files folder="components/com_administratie/admin">
<file>administratie.php</file>
</files>
</administration>
</extension>

And installed it, which worked, the administratie link is added in my components drop down, except when I click on it, the page shows a 404 component not found error.

Maybe I wrote something wrong in my xml file? I can't find what it is. This is my folder structure:

administrator
-components
--com_administratie
---admin
---administratie.xml
----administratie.php (this file has a simple echo in it)

I already tried refreshing the cache but I keep getting the same error.

I am on Joomla version: Joomla! 3.8.1 Stable

1 Answer 1

1

From your question it is ambiguous whether your entry file is inside the admin subfolder or not. It should be in the com_administratie folder if it isn't. Also your xml files declaration looks odd:

<files folder="components/com_administratie/admin">
<file>administratie.php</file>
</files>

The folder attribute should just be site or admin. While sub folders can be included as folder elements. So something like the following:

<files folder="admin">
  <filename>administratie.php</filename>
  <folder>admin</folder>
</files>

If you're only using discovery to install then the file declarations don't matter as much. In any case, the component will look at

/administrator/components/com_administratie/administratie.php

as the default entry file without much prompting.

2
  • Thank you,this worked. I followed a tutorial which said I had to add the .php file in a subfolder, when I moved it one level up the component showed up in my backend!
    – twan
    Commented Sep 6, 2019 at 7:10
  • cool. glad to help. Commented Sep 6, 2019 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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