Jump to content
IPSGoza

Help Guide Templates


  1. Let's being our Page

    We'll need to create our Help Guide page with the manual HTML option. In the content portion, we'll want to insert our html code:
    <div class="ipsBox ipsPad"> <div class="ipsColumns ipsColumns_collapsePhone" id="elGuides_columns"> {{if \IPS\Request::i()->do !='edit' and \IPS\Request::i()->do !='form'}} <div class="ipsColumn ipsColumn_wide" id="HelpBar"> <div data-ipssticky data-ipssticky-relativeto="#HelpBar"> {block="help_guide_bar"} </div> </div> {{endif}} <div class="ipsColumn ipsColumn_fluid"> <div class="ipsPadding"> {database="help-guide"} </div> </div> </div> </div> Replace {database="help-guide"} with your database key. If you do not know what your database key is, if the database is  already created it will show on the right side under database. If not, create a database and edit your page again and it will reappear again. 
    Lastly, block name can be changed to whatever your want. 
     
     
     
     
     
     
     
     
     
     
     
     
  2. Our side block

    The most important meat of the guide is the block that holds all the information and display that information onto the page. Here I will show how you create that block. 
    Navigate in AdminCP > Page Management > Block
    Note: Your database name doesn't have to be called help guide but it does help we use the correct database that will show the block on. 
    Details
    Name: Name of the block (can be called anything). Template Key: Name will be used to show on the page that will allows the block appear. Feed Configuration
    The main thing we really wanted to focus is number to show. This number also includes <h3> title as part of the count. Keeping it really high will ensure everything will show; if it doesn't show up, increased the number until the content is shown. Everything else in the feed configuration is community preference. 
    Content
    Drop down: use as a base for a custom template
    {{$recordClass = null;}} {{$catClass = null;}} {{if count($records)}} {{$recordClass = get_class($records[0]);}} {{$catClass = '\IPS\cms\Categories' . $recordClass::database()->_id;}} {{endif}} {{$firstRecord = null;}} {{$currentUrlPath = \IPS\Request::i()->url()->data['path'];}} {{if count($records) and $catClass and count($catClass::roots())}} <ul class="ipsList_reset cGuides" data-controller="guides.main"> {{foreach $catClass::roots() as $root}} <li> <h2>{$root->_title}</h2> {{if count($root->children())}} <ul class="ipsList_reset"> {{foreach $root->children() as $child}} <li class="cGuides_closed"> <h3 data-action="expandSection"> {$child->_title} </h3> {{foreach $records as $record}} {{if $record->container()->_id == $child->_id}} <ul class="ipsList_reset"> {{if $firstRecord == null}} {{$firstRecord = $record;}} {{endif}} <li> <a {{if $currentUrlPath === $record->url()->data['path']}}class="cGuides_active"{{endif}} href="{$record->url()}"> {$record->_title} </a> {{if $record->isFutureDate() || $record->mapped('pinned') || $record->mapped('featured') || $record->hidden() === -1 || $record->hidden() === 1 || $record->hidden() === -2}} {{if $record->isFutureDate()}} <span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$record->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span></span> {{endif}} {{if $record->hidden() === -1}} <span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$record->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span></span> {{elseif $record->hidden() === -2}} <span><span class="ipsbadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$record->deletedBlurb()}'><i class='fa fa-trash'></i></span></span> {{elseif $record->hidden() === 1}} <span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span></span> {{endif}} {{if $record->mapped('pinned')}} <span><span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span></span> {{endif}} {{if $record->mapped('featured')}} <span><span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span></span> {{endif}} {{endif}} </li> </ul> {{endif}} {{endforeach}} </li> {{endforeach}} </ul> {{endif}} <ul class="ipsList_reset"> {{foreach $records as $record}} {{if $record->container()->_id == $root->_id}} {{if $firstRecord == null}} {{$firstRecord = $record;}} {{endif}} <li> <a {{if $currentUrlPath === $record->url()->data['path']}}class="cGuides_active"{{endif}} href="{$record->url()}"> {$record->_title} </a> {{if $record->isFutureDate() || $record->mapped('pinned') || $record->mapped('featured') || $record->hidden() === -1 || $record->hidden() === 1 || $record->hidden() === -2}} {{if $record->isFutureDate()}} <span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$record->futureDateBlurb()}'><i class='fa fa-clock-o'></i></span></span> {{endif}} {{if $record->hidden() === -1}} <span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$record->hiddenBlurb()}'><i class='fa fa-eye-slash'></i></span></span> {{elseif $record->hidden() === -2}} <span><span class="ipsbadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{$record->deletedBlurb()}'><i class='fa fa-trash'></i></span></span> {{elseif $record->hidden() === 1}} <span><span class="ipsBadge ipsBadge_icon ipsBadge_warning" data-ipsTooltip title='{lang="pending_approval"}'><i class='fa fa-warning'></i></span></span> {{endif}} {{if $record->mapped('pinned')}} <span><span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="pinned"}'><i class='fa fa-thumb-tack'></i></span></span> {{endif}} {{if $record->mapped('featured')}} <span><span class="ipsBadge ipsBadge_icon ipsBadge_positive" data-ipsTooltip title='{lang="featured"}'><i class='fa fa-star'></i></span></span> {{endif}} {{endif}} </li> {{endif}} {{endforeach}} </ul> </li> {{endforeach}} </ul> {{endif}} {{if $recordClass and \IPS\cms\Pages\Page::$currentPage and (string) \IPS\cms\Pages\Page::$currentPage->url() == (string) \IPS\Request::i()->url()}} {{if $firstRecord}} {{\IPS\Output::i()->redirect($firstRecord->url(), '', 302);}} {{else}} {{\IPS\Output::i()->redirect(\IPS\Http\Url::internal(''), '', 302);}} {{endif}} {{endif}}  
×
×
  • Create New...