Documentation

A draft version of the User Documentation is now available for the Custom Page module.

What is it?

Custom Page is an advanced theming tool, allowing developers to easily create pages with custom templates and maintain full control over the output (e.g. HTML). Custompage seamlessly integrates with the Context module (both versions 2 and 3) module and while Context is not required, the two work great in tandem.

Features

  1. Easily attach a theming function and/or tpl.php to a URL path/pattern.
  2. Theme Taxonomy term pages for better SEO and presentation.
  3. Seamless integration with the Context module (Caution: use custompage_region_tile($region_name) to include regions in custom pages, not template variables!)
  4. Utility functions to easily aggregate content items like nodes, regions and views on any template page (custompage or Drual's own node-{type}.tpl.php, views-*.tpl.php, page.tpl.php etc.)
  5. Ability to package both data collection functions, as well as initial theme in a module and ship it in an easily distributable way, with the ability to allow later customizations on a theme layer.
  6. Rigorous multilingual support. You tell Custom Page to include a node with nid in site's default language and it will know to swap it with the translation node when language is switched.
  7. Internationalized Menus done simply and out-of-the-box. No other module needed (if you use custompage_menu_tile() to render a menu).
  8. A user-interface enhancement that allows inline editing of the aggregated content items: nodes and views on a custom page itself.

How is it different from existing theming templates?

Why not just use page-node-nn.tpl.php?

If you created page-node-1.tpl.php that would override entire page, whereas Custom Page only overrides the "content" area, inheriting the header, footer and all other regions. You probably don't want to duplicate those, in most cases. PHPTemplate, currently, does not allow to create templates like node-1.tpl.php. You would have to create a node type for each such page to use node-type.tpl.php, which is conceptually wrong if you consider nodes as _content_ items.

The biggest point of all is that even if you created a tpl.php with just PHPTemplate's default tools, it would still fall short of the extensive feature-set Custom Page provides (see above), especially if your site is multilingual.

And, what about Panels Module?

In a sense, Custom Page module is developer's version of the Panels module. If you like the functionality of Panels2, but your custom pages are not supposed to be further customized by the users, hence you don't care about the whole drag-and-drop thing, but do care about more flexibility and more lightweight, much faster implementation - Custom Page is the thing for you. Also, Custom Page has more automated approach to handle multilingual content.

This project is sponsored by Phase2 Technology

Project Information

Downloads