Theme Basics Creating an e107 theme

Core Shortcodes

Commonly used core theme shortcodes are listed below.

Name Description
{---} Renders the main content of the current page.
{CMENU=xxxxxx} Renders a specific custom menu item as defined in admin -> Pages/Menus. xxxxxx = menu name.
{LOGO} The site's logo as defined in the admin preferences.
{MENU=1} Menu Area as allocated using the media-manager in admin. Add multiple areas by incrementing the numeric value.
{MENU: type=xxxxxx} When xxxxxx is NOT a number, it will attempt to render a specific menu with the name xxxxxx. eg. {MENU=contact} will render e107_plugins/contact/contact_menu.php
{NAVIGATION=xxxxx} Bootstrap-style navigation. Where xxxxx is one of: main, side, footer, alt, alt5, alt6 eg. {NAVIGATION=footer}
{SETSTYLE=xxxxxx} A special shortcode which is used to dynamically change the value of $style as used inside tablerender() to the value of xxxxxx.
{SETIMAGE: w=x} A special shortcode which is used to dynamically change the size of avatars and other images. x= numerical value. eg. {SETIMAGE: w=100&h=200&crop=1}
{SITEDESCRIPTION} The description of the website as defined in the admin preferences.
{SITEDISCLAIMER} The site disclaimer as defined in the admin preferences. Typically used in the footer of the site.
{SITENAME} The name of the website as defined in the admin preferences.
{WMESSAGE} Renders the welcome message as defined in admin-> Welcome Message.



Usage example:

$LAYOUT['default'] = "
    <header>{SITENAME}<header>
    <div>{NAVIGATION=main}</div>
    {SETSTYLE=menu}
    <div class='span2'>
    {MENU=1}
    {MENU=contact}
    </div>
    <div class='span10'>
    {SETSTYLE=default}

 {---}

    </div>
    <footer>{SITEDISCLAIMER}</footer>
";

function tablestyle($caption, $text, $mode='')
{
    global $style; // value defined by {SETSTYLE} shortcode. 
 
    switch($style) 
     {
        case 'menu': 
            echo "<h5>".$caption."</h5>";
            echo $text;
        break;

        default: 
            echo "<h2>".$caption."</h2>";
            echo $text;
        break;
    }
    
}

News


Shortcode Description Optional Parameters
{NEWS_ID} Unique ID for the current news item (news_id)
{NEWS_TITLE} News Title
{NEWS_SUMMARY} News item summary
{NEWS_DATE} News Date
{NEWS_BODY} News Body (main content)
{NEWS_TAGS} New Keywords/Meta-Keywords
{NEWS_URL} News URL (current URL)
{NEWS_AUTHOR} Name of the Author of the news item
{NEWS_AUTHOR_AVATAR} Avatar of the Author of the news item
{NEWS_AUTHOR_SIGNATURE} Signature text of the Author of the news item. eg. a short bio about the user.
{NEWS_AUTHOR_ITEMS_URL} Link to a News page listing all items by the same author.
{NEWS_CATEGORY_NAME} News Category Name
{NEWS_CATEGORY_DESCRIPTION} News Category Description
{NEWS_CATEGORY_ICON} News Category Icon
{NEWS_RELATED} Related news items based on keyword matches types: news | page
limit: (integer) (default is 5)

Page/Menu


Shortcode Description Optional Parameters
{CPAGEANCHOR}
{CPAGETITLE} Title of the page
{CPAGEBODY} Main text body of the page
{CPAGEAUTHOR} Author of the page
{CPAGEDATE} Creation date of the page {CPAGEDATE=x} default: long. 'short' and 'relative'
{CPAGEMETADIZ} Meta description of the page.
{CPAGEBUTTON}
{BOOK_ANCHOR}
{BOOK_DESCRIPTION}
{BOOK_ICON}
{BOOK_ID}
{BOOK_NAME}
{BOOK_URL}
{CHAPTER_ANCHOR}
{CHAPTER_BREADCRUMB}
{CHAPTER_BUTTON}
{CHAPTER_DESCRIPTION}
{CHAPTER_ICON}
{CHAPTER_ID}
{CHAPTER_NAME}
{CHAPTER_URL}

Thursday 13 June 2013 - 00:00:00 admin,