Have you seen our video tutorials? Check 'em out!

field_type and custom view file in the frontend

huglester - 1 month ago

so I publish view like so: php artisan addon:publish anomaly.field_type.text

but when I edit the resources/default/addons/anomaly/text-field_type/views/input.twig, the changes are reflected in the backend as well as backend. What to do if I want to reflect only frontend?

thank you

Answer

ryanthompson - 1 month ago

You can override this view with protected $overrides from your public theme.

ryanthompson - 1 month ago

You can override this view with protected $overrides from your public theme.

ryanthompson - 1 month ago

Or by using the addons/(vendor)/(slug)-(type)/(path) override method as well.

huglester - 1 month ago

I have updated now the: class StarterThemeServiceProvider extends AddonServiceProvider {

/**
 * The view overrides.
 *
 * @var array
 */
protected $overrides = [
    'streams::errors/404' => 'theme::errors/404',
    'streams::errors/500' => 'theme::errors/500',

    'anomaly.field_type.text::input' => 'theme::forms/text',
];

}

later added the: core/pyrocms/starter-theme/resources/views/forms/text.twig

and now it's ok