Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Theme options #5

Open
voltan opened this issue Feb 1, 2013 · 2 comments
Open

Theme options #5

voltan opened this issue Feb 1, 2013 · 2 comments
Assignees
Labels

Comments

@voltan
Copy link
Collaborator

voltan commented Feb 1, 2013

It good idea if we have some options for manage themes in theme manager, like blocks. I think about some little options like :

<?php
/**
 * Pi Engine default theme configuration
 *
 * You may not change or alter any portion of this comment or credits
 * of supporting developers from this source code or any supporting source code
 * which is considered copyrighted (c) material of the original comment or credit authors.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * @copyright       Copyright (c) Pi Engine http://www.xoopsengine.org
 * @license         http://www.xoopsengine.org/license New BSD License
 * @author          Taiwen Jiang <[email protected]>
 * @since           3.0
 * @package         Pi\Theme
 * @version         $Id$
 */

/**
 * A complete theme set should include following files:
 *
 * Folder and file skeleton:
 * REQUIRED for front:
 *  tmplate/layout-front.phtml - complete layout template: header, footer, body, blocks, navigation
 *  tmplate/layout-simple.phtml - error page layout: header, footer, body
 *  tmplate/layout-style.phtml - content with stylesheets
 *  tmplate/layout-content.phtml - raw content without stylesheets
 * REQUIRED for admin:
 *  tmplate/layout-admin.phtml - backoffice layout
 * OPTIONAL for front:
 *  template/page-zone.phtml - for block manipulation on a page
 *
 * Stylesheet files:
 * REQUIRED:
 *  asset/css/style.css - main css file
 *
 * Best practices:
 *  1 It is hightly recommended to use 'pi-' as prefix for all id's used in theme to avoid conflicts.
 */

return array(
    /**#@+
     * To be stored in DB
     */
    // Version
    'version'       => '1.0.0-beta.1',
    // Type of layouts available in the theme
    'type'          => 'both', // Potential value: 'both', 'admin', 'front', default as 'both'
    /**#@-**/

    // Title of the theme
    'title'         => 'Pi Default Theme',
    // Author information: name, email, website
    'author'        => 'Theme architecture: Taiwen Jiang <[email protected]>; Resources: Pi Engine Development Team',
    // Screenshot image, relative path in asset. If no screenshot is available, static/image/screenshot.png will be used
    'screenshot'    => 'image/screenshot.png',
    // License or theme images and scripts
    'license'       => 'Creative Common License http://creativecommons.org/licenses/by/3.0/',
    // Optional description
    'description'   => 'Default theme for Pi Engine',
    // Options
    'option' => array(
        // Header text
        'header_text' => array(
            'title' => __('Header text'),
            'edit' => 'textarea',
            'value' => 'My HTML text for show on header',
       ),
       // Show title
       'title' => array(
            'title' => __('Show title'),
            'edit' => 'checkbox',
            'filter' => 'number_int',
            'value' => 1,
       ),
       // Show search
       'search' => array(
            'title' => __('Show search'),
            'edit' => 'checkbox',
            'filter' => 'number_int',
            'value' => 1,
       ),
       // select header
       'header_image' => array(
            'title' => __('select header image'),
            'filter' => 'string',
            'value' => 'image1.png',
            'edit' => array(
                'type' => 'select',
                'options' => array(
                    'options' => array(
                        'image1.png',
                        'image2.png',
                        'image4.png',
                    ),
                ),
            ),

       ),
    ),
);

Manage option available in theme admin and we can use options in themes easy

    <div class="header clearfix">
        <?php if($option['title']) { ?>
        <div class="container clearfix">
                <a href="<?php echo Pi::url('www'); ?>" title="<?php echo $this->escape($sitename); ?>" class="header-logo"><?php echo $this->escape($sitename); ?></a>
        </div>
        <?php } ?>
    </div>
@ghost ghost assigned taiwen Feb 6, 2013
@taiwen
Copy link
Owner

taiwen commented Feb 6, 2013

I am going to take a look

@voltan
Copy link
Collaborator Author

voltan commented Feb 6, 2013

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants