A Different Way of Enabling Clients to Administer Drupal Web Pages

Better Drupal Administration UI for content editors & client admins
Better Drupal Administration UI for content editors & client admins

I call this approach the "Page Parts" methodology - and I have a slick View to assist with a better user interface for content administrators, other than just handing over the Drupal admin password:

See if you can pick up a few tips via this code snippet, and I'll post more details as time permits?

<?php
/**
* Gets the specified Page Part content associated with TID for page section.
*
* @param {int}     tid: Taxonomy Term ID associated with Page Part.
* @param {string}  type: Content type (image, text)
* 
* @return {string} Content from node. 
*/
function get_pagepart( $tid, $type ) {
    try {
 
        $term = taxonomy_term_load($tid);
        $pagePart = node_load($term->field_ppt_page_part['und'][0]['nid']);
 
        switch ($type) {
            case 'image':
                $content = $pagePart->field_pp_image['und'][0]['uri'];
                break;
 
            case 'text':
                $content = $pagePart->body['und'][0]['value'];
                break;
 
            default: break;
        }
 
        return $content;
 
 
    } catch(Exception $e) {
        return '';
    }
}

Tags: