Robin S Posted June 11, 2016 Share Posted June 11, 2016 Is it possible to have a module that autoloads so admin methods can be hooked and also works as a textformatter? Or is creating two modules the only way? Setting an autoload value in getModuleInfo() seems to have no effect if the module extends the Textformatter class. Two modules would be okay for installation as one can auto-install the other, but needing two module config pages is bit of a pain. And the only other solution I can see is having one module store config data for the other, and that seems wrong. Link to comment Share on other sites More sharing options...
LostKobrakai Posted June 11, 2016 Share Posted June 11, 2016 Can you explain what you're trying to do? It seems quite odd for a textformatter to be autoloaded. Link to comment Share on other sites More sharing options...
Robin S Posted June 11, 2016 Author Share Posted June 11, 2016 The module(s) is a helper for working with images in rich text fields. So part of the functionality is about inserting and applying attributes to images in the RTE and part is sizing the images and and generating markup based on those attributes via a textformatter. Currently I'm splitting this functionality into two modules, but I would rather do it in a single module with a single configuration page. Not sure why it should be forbidden to autoload a textformatter module. To work around this, if my module extends WireData instead of Textformatter is there a way to manually apply a textformatter method via a hook? Edit: thinking some more, the textformatter side really does need to be separate so it can be applied selectively to fields. So two modules it is. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now