Jump to content

core modules with core templates


Herbert Kilby

Recommended Posts

Pardon me if I'm dense, but I am having some problem wrapping my brain around development and design. I understand the model-controller-view structure and a need to keep them separate in order to allow updating without spoiling customization and vice versa; but, it would seem we have some things that would defeat this purpose. Let me explain:

 

For example:

  • blockcategories is a native module located in /modules/blockcategories which includes the model and view (template). Is the blockcategories.php a model and controller?
  • Why is the template here and not a under the theme folder?
  • Is there a heirarchy for templates? If I create a blockcategories.tpl under a theme does it supercede the blockcategories.tpl under the core modules?

If there is no heirarchy, then is the solution to build an independent module that would replace the core module, that would be unique to a template? If this is the action needed then I guess you would hook this new module instead of the native module; but then this would spoil other templates.

 

Has anyone had this issue? Are there any other suggestions on how to work around the a core module setting the html?

Link to comment
Share on other sites

The module is both the model and the controller, but very different from prestashop controllers. It also does not have to be. You can create your own class files, and instantiate them from within the module.

 

The template files are stored in the module folder, and I am sure that was designed that way for simplicity and to make the modules portable. However the modules css, theme and js files can be moved under the theme folder if they need to be altered for a specific site.

 

the theme folder supports placing ...

templates under \themes\<theme>\modules\<name>\

css under \themes\<theme>\css\modules\<name>\

js under \themes\<theme>\js\modules\<name>\

Link to comment
Share on other sites

Thanks for your reply. I guess if I'm gonna have to hack the core tpl, I'll have to keep track of which are hacked so when an update comes, there won't be any suprises.

 

I personally think it is bad form, that templates can be in more than one location. This is not addressed in the documentation; in fact, the documentation on design tends to talk down to you like you are some idiot and that the writer could not imagine why anyone would want to make modifications other than maybe changing a color of font via css.

Edited by Herbert Kilby (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...