Experimental project

This is a sandbox project, which contains experimental code for developer use only.

Custom Page Layouter

Custom Page Layouter provides a simple inline interface for resizing and sorting elements on a Custom Page. This module provides both: an easy object oriented way to configure pages for developers, and an intuitive Drag & Drop interface for users.

Use case

Your clients want a fancy web 2.0 frontpage with many different blocks, lists and other elements. So you create a Custom Page, to display all your views and nodes. Everything works just fine, but suddenly your client says: I want to have view X for the next two weeks at the top position.

You could check your theme out, edit the template file and deploy it, every time your client wants one little change. Or you could use Custom Page Layouter, and your client can Drag & Drop view X at position whatever.

Why not use panels?

Panels are too complex for clients who only want to add and manage content. Custom Page provides a simple and powerful way to create custom layouts, however without the ability to change them without editing the templatefile. Custom Page Layouter takes care of this.

Custom Page Layouter & Domain Acess

Custom Page Layouter can save individual configurations not only for templates but also for domains.

For developers

  1. Create a simple Custom Page (e.g. "frontpage.tpl.php")
  2. Initialize a new cp_layouter Object
    $layouter = new cp_layout("frontpage");
  3. Add Elements to the layouter
    $archiv = new StdClass;
    $archiv->title = "Archive";
    $archiv->type = "view";
    $archiv->id = "archive";
    $archiv->con = "block";
    $archiv->min = 1;
    $archiv->max = 9;
    $layouter->add($archiv, true);
  4. Render it!
    echo custompage_layouter_render($layouter);

For users

  1. Log in
  2. Drag & Drop & Resize
  3. Save & Done!

Drag & Drop Resize and Sort

Development Status

Not finished jet, but you can check the master branch out to test it.

Example-usage

Components
===================================================
Every feature of the website (e.g. news, team, events, …) consists of
up to three parts.

Content-type
----------------------------------------------------------------------
The content-type defines all fields, and configure the way admins can
edit theme. In our micro-MVC-system content-types are models.

Views
----------------------------------------------------------------------
Aggregate, filter, publish content, defined by content-types. Those are
our controllers.

Views-Templates
----------------------------------------------------------------------
Views-Templates manage the display of every view.

Custom pages
----------------------------------------------------------------------
This is a collection of views and other components. Custom pages can
be managed domain sensitively. Every element on a custom page has a
grid-width-index (e.g. 12). Because of this the user can define the
width of each block, but the layout remains responsive.

Workflow
===================================================

Basic workflow for new features:
----------------------------------------------------------------------
1. Create a new content-type
2. Create view-blocks to aggregate nodes
3. Create templates for your view-blocks
4. Create a custom page where views can be displayed

Example: Team & Friends
----------------------------------------------------------------------
- First we create two content-types: "members" and "friends". Members
have lots of fields like name, multiple photos, a description, or
contact-infos. Friends only have a name and a photo. We create three
view-blocks (and their template-files):
1. Complete team
2. Random Member
3. Friends

- We add a filter to only show members of the current domain, but all
friends on all domains. When we create the templates we do not use
any fixed width, but make the block fluid as flexible as possible.

- We create a new custom page (/team), which contains the three views
and saves it's configuration domain sensitive.

- Finito!

For each domain the views are now displayed automatically in a default-
way. Site-builder of each domain can now customize the order and width
of the element (e.g. A small village can hide the team view but only
show all friends).

Project information

  • Created by killerpoke on , updated