We are working on a site for a client. This page has in total about 30 different pages. Each page has a unique and complicated design. In order to give the client the possibility to edit texts on the pages without changing the design we created text fields for each content type. Each content type has around 30 fields (text or long text) which we manually render in the template files. Each field has a unique machine name. We always created a new field whenever we needed a new field in one of the content types. And each content type has only a few contents (variation of the page).

Current structure:

Content type 01
    Field 01
    Field 02
Content type 02
    Field 05
    Field 06

The question now is if there is a better way of building such a architecture, since we are having a quite large php memory usage. The idea of drupal is to create a content type and have then a lot of contents of that type. But that approach doesn't fit to our customized page design.

One possible solution which we gathered is to reuse the fields in all the content types. Originally we named the fields in the example above field_content_type_01_field_01 and field_content_type_02_field_05. This solution would mean we have to change the fields to have field_field_01 and reuse that field in all content types.

But is there a better way for our setup?


Option 1: Panels

Maybe you should check to what extend your unique and complicated design of each page" could be implemented using the Panels module. Some details from its project page:

The Panels module allows a site administrator to create customized layouts for multiple uses. At its core it is a drag and drop content manager that lets you visually design a layout and place content within that layout. Integration with other systems allows you to create nodes that use this, landing pages that use this, and even override system pages such as taxonomy and the node page so that you can customize the layout of your site with very fine grained permissions.

Learn Page manager! is an interesting (and amazing) set of videos. They contain various topics related to the Panels module. Here is a summary of the entire set of videos about this topic (quote from the link above):

  • Page manager allows you to collect and manage contextual information in a flexible and consistent way. It is an important part of building infrastructure on Drupal websites, and you should know how to use this module.
  • The screencast series is targeted at experienced Drupal developers.
  • Episodes 1, 2 and 3 introduces the most basic concepts, such as custom pages, variants, selection rules and (to some extent) contextual objects.
  • Episodes 4, 5, 6 and 7 talk about Panels, with emphasis on Views integration but also some words on efficient caching.
  • Episodes 8 and 9 about access control, menu items, and not least the little-known but very useful Contextual Administration module.
  • Episodes 10 and 11 talks more about using contextual objects in Page manager, including using Views as context. This is, imho, where the real power in Page manager is.
  • Episodes 12 and 13 collects various bits and pieces, such as how to use Panels to easily rearrange the node edit form, import/export settings, and some extra modules that can be used with Page manager.

Refer to Explaining Panels: An Overview for Drupal Developers for another great explanation about the Panels module.

Option 2: Display Suite

Another approach is to use the Display Suite module. Some details from its project page:

Display Suite allows you to take full control over how your content is displayed using a drag and drop interface. Arrange your nodes, views, comments, user data etc. the way you want without having to work your way through dozens of template files. A predefined list of layouts (D7 only) is available for even more drag and drop fun!

By defining custom view modes (build modes in D6), you can define how one piece of content should be displayed in different places such as teaser lists, search results, the full node, views etc.

Screencasts & articles about Display Suite has numerous screencasts with more details about it.

  • Thank you, but all that doesn't fit in our situation. We are using display suite, that can't help with the original problem, how to setup the content types. Displaying the data is totally fine how it is. Our question is the setup... – Andreas Daoutis Oct 9 '15 at 6:17

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