In our specific website project use case - we want to implement "module" features implemented through theme.

Use case : In our website project, we want to create custom content type programmatically(through module), but in our use case - can we create the same through theme.

There could be many use cases for the above requirement, but we want to make our site more manageable and cleaner for the system admin.

If the above can be done through theme - how to implement the above. Is there any limitation doing this way.

If someone could shed light on this.

  • 1
    Themes can require modules as dependency, and the required module then brings these features. – leymannx Mar 6 at 11:06

To put it simply:

  • Themes provide the look and feel of the site (how the pages are styled).
  • Modules provide functionality to the site.
  • A content type is a way of storing data in the database.

A theme doesn't contain, for example, code to allow users to log in, or to change how users log in, which is code that instead into a module. Similarly, the logical place for a content type is a module, not a theme.

In your case, I would add one custom theme and one custom module; this will not make the site significantly more complicated for the admin. In fact, if the module merely provides the content type, then the admin will have no configuration to perform other than enabling the module.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.