Override /@username users module view from addon ServiceProvider
Created 4 years ago by finnitoHey all,
I'm attempting to override the /@username
view of the Users Module in order to provide a better front-end interface for a module I am creating. I have read the page on how to override views and settled on doing it through the service provider as that allows me to take the override with me when I install a module without having to worry about publishing the addon or anything weird.
My addon has the slug: finnito.module.members
and I've opened up MembersModuleServiceProvider.php
and added:
/**
* The addon view overrides.
*
* @type array|null
*/
protected $overrides = [
"anomaly.module.users::users.view" => "finnito.module.members::users.view",
];
And I created the view in addons/pyrotest/finnito/members-module/resources/views/users/view.twig
{% extends layout('users') %}
{% block content %}
<p>Some different content should go here</p>
{% endblock %}
But to no avail. I also tried making the override like this because I was a little unsure of the syntax:
/**
* The addon view overrides.
*
* @type array|null
*/
protected $overrides = [
"anomaly.module.users::users/view" => "finnito.module.members::users/view",
];
But I'm not having any luck. I'm sure it's just a little thing I've missed, so any pointers would be much appreciated!
- Finn
I figured out that I can do it like this:
Where that controller method just does
abort(404)
.