Skip to content

New Addon template tags breaks entry preview #3594

Description

@acutedeveloper

Description of the problem

I have created a new template tag by create a new Addon using the eecli and then setting up new template tag using the make:template-tag.

The template tag will output its content fine in the websites templates. However when editing entries in the control panel, the preview pane presents this error:

ExpressionEngine\Service\Addon\Exceptions\ControllerException Caught

Invalid Module request! Are you sure \addonDeveloper\TemplateTag\Actions\Output is setup properly?

ee/ExpressionEngine/Service/Addon/Module.php:72

What testing I have tried

I have created a vanilla addon simply called template tag. I have setup a template tag within that addon with an output method.

This is the content of the Tags/Output.php file

<?php

namespace AcuteDeveloper\TemplateTag\Tags;

use ExpressionEngine\Service\Addon\Controllers\Tag\AbstractRoute;

class Output extends AbstractRoute
{
    // Example tag: {exp:templatetag:output}
    public function process()
    {
        return "My tag";
    }
}

In the frontend templates, it outputs fine. In the control panel previews, the error above is presented.

My setup

  • EE 7.2.6
  • Using structure templates
  • Testing on my local laravel valet environment

I have a _base.html file that is extended by templates in a layout folder.

layouts
     - _base.html
     - _homepage.html

How To Reproduce

  1. Ensure you have templates that you can preview in the entries preview pane
  2. Create a new Addon with make:addon.
  3. Create a new template tag with make:template-tag.
  4. Add your new template tab to your template
  5. Preview the template in a new entry
  6. Error presented

Possible Solution
For now Im trying the older pi.addon_name.php plugin file style.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: AcceptedBug has been confirmed, is reproducible, and ready to work on.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions