0

I want to create a single view=help to display HTML code instead of the form view=item&layout=edit to the Joomla 4 Components administrator area, is it possible to achieve it? right now I am facing an error

0 Table help not supported. File not found.

1
  • Yes, it's possible. You should post the relevant code you have written so far.
    – Sharky
    Jul 31, 2023 at 7:54

1 Answer 1

1

Yes.

I am assuming you have copied a sample of an edit view and haven't properly removed the lines of code relevant to loading a Form and Data and that is why you are getting a file not found message.

In its simplest form a Joomla 4 View needs to only have a display() method

use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;

class HtmlView extends BaseHtmlView
{
    public function display($tpl = null): void
    {
        parent::display($tpl);
    }
}

and a template file in called default.php, eg. \tmpl\help\default.php, to be displayed.

<?php
defined('_JEXEC') or die;
?>
<div>
    <p>Hello</p>
</div>

This will use the DisplayController, it does not need its own controller.

As @Sharky suggests in his comment, providing the code that you have written or are modifying in your question would make it easier to help you and provide more specific answer rather than us assuming what code you have.

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.