info:concrete5:cheatsheet_concretecms

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
info:concrete5:cheatsheet_concretecms [2025/09/19 05:06] – radeffinfo:concrete5:cheatsheet_concretecms [2026/03/26 14:01] (Version actuelle) – supprimée radeff
Ligne 1: Ligne 1:
-====== Radeff's Themes and Style Sheets ====== 
-<note important>attention, bon nombre des infos //infra// sont obsolètes dès la v9! à manier avec prudence</note> 
-===== Get Style Sheet ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-$this->getStyleSheet(); 
  
-Load stylesheet in header 
- 
-<?php echo $this->getStyleSheet('main.css')?> 
-</code> 
-===== Get Theme Path ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-$this->getThemePath(); 
- 
-Use to load an image from theme image directory 
- 
-<img src="<?=$this->getThemePath()?>/images/photo.png"> 
- 
-OR 
- 
-<?php 
-  $v = View::getInstance(); 
-  $v->getThemePath(); 
-?> 
-</code> 
-===== Set Theme Path ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-Use a Theme Path In a Block 
- 
-<?php 
-  $v = View::getInstance(); 
-  $themePath = $v->getThemePath(); 
-?> 
- 
-  To display an image from your themes image directory 
-   
-  <img src="<?php echo $themePath ?>/images/photo.png"> 
-</code> 
-====== Working With Blocks ====== 
- 
-===== Add a Block Area ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php  
-    $a = new Area('AREA_NAME'); 
-    $a->display($c); 
-?> 
-</code> 
-===== Wrap Each Block In An Area With Divs ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php  
-  $a = new Area('sidebar'); 
-  $a->setBlockWrapperStart('<div class="box">'); 
-  $a->setBlockWrapperEnd('</div>'); 
-  $a->display($c);  
-?> 
-</code> 
-===== Add Space Between Blocks In Edit Mode ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php  
-  if ($c->isEditMode()) { ?> 
-    <div style="min-height: 20px;"> </div> 
-  <?php } ?> 
-</code> 
-===== Add a Global Area for a Stack In a Page ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
- 
-<?php 
-  $a = new GlobalArea('STACK_NAME'); 
-  $a->display(); 
-?> 
-</code> 
-===== Add a Stack In a Page ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
- 
-<?php 
-$stack = Stack::getByName('STACK_NAME'); 
-$stack->display(); 
-?> 
-</code> 
-===== Get Stack Names (or Handles) ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
- 
-<?php 
-  Loader::model('stack/list'); 
-  $stm = new StackList(); 
-  $stm->filterByGlobalAreas();  
-  // Use filterByGlobalAreas() or filterByUserAdded() 
-  $stacks = $stm->get(); 
-  
-  foreach($stacks as $st) { 
-    print  $st->getCollectionName(); 
-    //  Use $st->getCollectionName(),  $st->getCollectionHandle(), etc. 
-  } 
-?> 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
- 
-<?php 
-  $stm = new StackList(); 
-  $stm->filterByGlobalAreas();  
-  // Use filterByGlobalAreas() or filterByUserAdded() 
-  $stacks = $stm->get(); 
-  
-  foreach($stacks as $st) { 
-    print  $st->getCollectionName(); 
-    //  Use $st->getCollectionName(),  $st->getCollectionHandle(), etc. 
-  } 
-?> 
-</code> 
- 
-===== Get URL for Block Directory ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<img src="<?php echo $this->getBlockURL() ?>/images/image.png"> 
-</code> 
-====== Working with Pages in Blocks and Themes ====== 
- 
-===== Add a Page Type ===== 
-<code php> 
-<?php 
-  /* Check if page exists. */ 
-   
-  Loader::model('collection_types'); 
-  $pageType = CollectionType::getByHandle('[page_type_handle]'); 
- 
-  /* Addd new page if does not exist. */ 
-   
-  if(!is_object($pageType)) { 
-    $data['ctHandle'] = '[page_type_handle]'; 
-    $data['ctName'] = t('[page_type_name]'); 
-    $newPage = CollectionType::add($data, $pkg); 
-  } 
-?> 
-</code> 
- 
-===== Display a Page's Parent Page Name ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-  $page=Page::getByID($c->getCollectionParentID()); 
-  echo $page->getCollectionName(); 
-?> 
-</code> 
-===== Display Top Level Parent Name ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php  
-  global $c; 
-  $nh = Loader::helper('navigation'); 
-  $cobj = $nh->getTrailToCollection($c); 
-      
-  $rcobj = array_reverse($cobj); 
-    if(is_object($rcobj[1])) { 
-      $pID  = $rcobj[1]->getCollectionID(); 
-      $page = Page::getByID($pID);   
-      echo $page->getCollectionName(); 
-    }else{ 
-      echo $c->getCollectionName(); 
-    }   
-?> 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
-<?php  
-  $c = Page::getCurrentPage(); 
-  $nh = Core::make('helper/navigation'); 
-  $cobj = $nh->getTrailToCollection($c); 
-  
-  $rcobj = array_reverse($cobj); 
-    if(is_object($rcobj[1])) { 
-      $pID  = $rcobj[1]->getCollectionID(); 
-      $page = Page::getByID($pID);   
-      echo $page->getCollectionName(); 
-    }else{ 
-      echo $c->getCollectionName(); 
-    }   
-?> 
-</code> 
-===== Get Current Page Object ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-global $c; 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
-$page = Page::getCurrentPage(); 
-</code> 
-===== Get Date The Page Was Added/Created ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-$c->getCollectionDateAdded('F j, Y') 
-?> 
- 
-Display date page was added. 
- 
-<?php echo $c->getCollectionDateAdded('F j, Y') ?> 
-</code> 
-===== Get Handle of Parent Page and Do Something ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-  $page=Page::getByID($c->getCollectionParentID()); 
-   
-  if ( $page->getCollectionName() == 'es' ) { 
-    echo '<a href="/index.php/gallery">Galería</a>'; 
-  } else { 
-    echo '<a href="/index.php/gallery">Gallery</a>'; 
-  } 
-?> 
-</code> 
-===== Get a Page's Description ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-$c->getCollectionDescription(); 
-   
-Display page description 
- 
-<?php echo $c->getCollectionDescription() ?> 
-</code>   
-===== Get a Page's Handle ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-$c->getCollectionHandle(); 
- 
-Create a div for adding styles to individual pages 
-   
-<div id="<?php echo $c->getCollectionHandle() ?> "> </div> 
- 
-Add a class to a div based on page handle 
-   
-<div id="header" class="<?php echo $c->getCollectionHandle() ?>"> </div> 
-</code> 
-===== Get a Page's ID ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-$c->getCollectionID(); 
-   
-Display page ID 
-   
-<?php echo $c->getCollectionID() ?> 
-</code> 
-===== Get a Page's Name ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-$c->getCollectionName(); 
-   
-Display page name 
-   
-<?php echo $c->getCollectionName() ?> 
- 
-</code> 
-===== Get a Page's Parent Page ID ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-$c->getCollectionParentID(); 
-   
-Display parent page page ID 
-   
-<?php echo $c->getCollectionParentID() ?> 
-</code> 
-===== Get a Pages Owner ID ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-$pageOwner = $c->getCollectionUserID() 
-</code> 
-===== Get Current Page URL ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-$nh = Loader::helper('navigation'); 
-$URL = $nh->getCollectionURL($c); 
-?> 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code> 
-<?php 
-$nh = Core::make('helper/navigation'); 
-$URL = $nh->getCollectionURL($c); 
-?> 
-</code> 
-===== Get a Page Type's Name ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-$c->getCollectionTypeName(); 
-   
-Set a class to a page types name. 
-   
-<?php  
-  if($c->getCollectionTypeName() == 'Full Width'){  
-    echo 'class="full-width"'; 
-  } 
-?> 
-</code> 
-===== Get Site Name ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-echo SITE; 
-?> 
-</code>  
-{{wiki:c57.png?nolink}} 
-<code php> 
-<?php 
-echo Config::get('concrete.site'); 
-?> 
-</code> 
-===== Get Public Date/Time In Page Properties ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-$c->getCollectionDatePublic('F j, Y') 
-   
-Display Public Date 
- 
-<?php echo $c->getCollectionDatePublic('F j, Y') ?> 
-</code> 
- 
-{{wiki:c57.png?nolink}} 
-<code php> 
-<?php 
-$dateHelper = Core::make('helper/date'); 
- 
-echo $dateHelper->getSystemDateTime($c->getCollectionDatePublic(), $mask = 'l, F d, Y  g:ia') 
-?> 
-</code> 
-===== Get Date Last Edited ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-// Load Date Helper 
-$date = Loader::helper("date"); 
-   
-// Get Blocks in Main area 
-foreach($c->getBlocks('Main') as $b) { 
-   $bDate[$i] = $b->getBlockDateLastModified(); 
-   $i ++; 
-} 
-  
-// Reverse Sort Date Array 
-rsort( $bDate ); 
-  
-//Echo Date and Time Page last Edited 
-echo $date->getLocalDateTime($bDate[0],$mask = 'm-d-Y g:i:s'); 
-?> 
-</code> 
- 
-{{wiki:c57.png?nolink}} 
- 
-<code php> 
-<?php 
-// Load Date Helper 
-$date = Core::make('helper/date');  
-  
-// Get Blocks in Main area 
-foreach($c->getBlocks('Main') as $b) { 
-   $bDate[$i] = $b->getBlockDateLastModified(); 
-   $i ++; 
-} 
-  
-// Reverse Sort Date Array 
-rsort( $bDate ); 
-  
-//Echo Date and Time Page last Edited 
-echo $date->getLocalDateTime($bDate[0],$mask = 'm-d-Y g:i:s'); 
-?> 
-</code> 
-===== Embed Autonav in a Theme Page ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php  
-  $bt = BlockType::getByHandle('autonav'); 
-  $bt->controller->displayPages = 'top'; // 'top', 'above', 'below', 'second_level', 'third_level', 'custom', 'current' 
-  $bt->controller->displayPagesCID = ''; // if display pages is set ‘custom’ 
-  $bt->controller->orderBy = 'display_asc';  // 'chrono_desc', 'chrono_asc', 'alpha_asc', 'alpha_desc', 'display_desc','display_asc'              
-  $bt->controller->displaySubPages = 'all';  //none', 'all, 'relevant_breadcrumb', 'relevant'           
-  $bt->controller->displaySubPageLevels = 'all'; // 'enough', 'enough_plus1', 'all', 'custom' 
-  $bt->controller->displaySubPageLevelsNum = ''; // if displaySubPages is set 'custom' 
-  $bt->render('view'); // for template 'templates/template_name'; 
-?> 
-</code> 
-====== Working With Page Attributes ====== 
- 
-===== Add a Page Attribute Programmatically ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-Loader::model('collection_types'); 
-Loader::model('collection_attributes'); 
- 
-// add checkbox attribute 
-$att = AttributeType::getByHandle('boolean'); 
-$testAttribute3=CollectionAttributeKey::getByHandle('attribute_handle'); 
-if( !is_object($testAttribute3) ) { 
-    CollectionAttributeKey::add($att, array('akHandle' => 'attribute_handle', 'akName' => t('Attribute Name'), 'akIsSearchable' => true, 'akCheckedByDefault' => true), $pkg); 
-} 
-?> 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
-<?php 
-namespace 
-use \Concrete\Core\Attribute\Type as AttributeType; 
-use CollectionAttributeKey; 
- 
-// add checkbox attribute 
-$att = AttributeType::getByHandle('boolean'); 
-$testAttribute3=CollectionAttributeKey::getByHandle('attribute_handle'); 
-if( !is_object($testAttribute3) ) { 
-    CollectionAttributeKey::add($att, array('akHandle' => 'attribute_handle', 'akName' => t('Attribute Name'), 'akIsSearchable' => true, 'akCheckedByDefault' => true), $pkg); 
-} 
-?> 
-</code> 
-===== Test That a Value Is Set in an Attribute ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-  if ($c->getCollectionAttributeValue(attribute_hande)) { 
-  Do Something Here; 
-  } 
-?> 
-</code> 
-===== Get a Page Attribute Value ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-$c->getCollectionAttributeValue() 
-   
-Display a page text attribute 
-   
-<?php echo $c->getCollectionAttributeValue('attribute_hande') ?> 
- 
-*In some blocks you may need to substitute with $cobj 
-</code> 
-===== Get an Attribute Key by Handle ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-Loader::model('attribute/categories/collection');  
-$atKey = CollectionAttributeKey::getByHandle('handle'); 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php>  
-$atKey = CollectionAttributeKey::getByHandle('handle'); 
-</code> 
-===== Display An Image From Page Attribute ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<img src="<?php echo ($c->getAttribute('attribute_handle')->getVersion()->getRelativePath());?>" width="120px" height="160px"> 
-</code> 
-===== If a Page File/Image Attribute Is Set, Display Download Link ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-  if($c->getAttribute('attribute_name')) { 
-    echo '<a href="' . $c->getAttribute('attribute_handle')->getVersion()->getRelativePath() .' ">Download PDF</a>'; 
-  } 
-?> 
-</code> 
-===== Get a File/Image Atributes File Name  ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-$c->getAttribute('attribute_handle')->getFileName()  
-?> 
-</code> 
-===== Get All Page Attributes ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-Loader::model('attribute/key'); 
-$atKeys = AttributeKey::getList('collection'); 
-  
-foreach($atKeys as $ak) { 
-  echo  $ak->akName . '<br/>'; 
-} 
-?> 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
-(in view.php) 
-<?php 
-$atKeys = CollectionAttributeKey::getList(); 
-  
-foreach($atKeys as $ak) { 
-  echo  $ak->akName . '<br/>'; 
-} 
-?> 
- 
-(in controller.php) 
- 
-<?php 
-namespace 
-use View; 
- 
-$atKeys = CollectionAttributeKey::getList(); 
-  
-foreach($atKeys as $ak) { 
-  pageAttributes[] =  $ak->akName; 
-} 
- 
-</code> 
- 
-{{wiki:v8.png?nolink}} 
-<code php> 
-(in view.php) 
-<?php 
-$atKeys = CollectionAttributeKey::getList(); 
-  
-foreach($atKeys as $ak) { 
-  echo  $ak->getAttributeKeyName() . '<br/>'; 
-} 
-?> 
- 
-(in controller.php) 
- 
-<?php 
-namespace 
-use View; 
- 
-$atKeys = CollectionAttributeKey::getList(); 
-  
-foreach($atKeys as $ak) { 
-  pageAttributes[] =  $ak->getAttributeKeyName(); 
-} 
- 
-</code> 
----- 
-===== Get all Attributes in a Set ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-Loader::model('attribute/key'); 
-Loader::model('attribute/set'); 
- 
-$atSet = AttributeSet::getByHandle('attribute_set_handle'); 
-$atKeys = $atSet->getAttributeKeys(); 
- 
-foreach($atKeys as $ak) { 
-  echo $ak->akName; 
-} 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
-(in view.php) 
-$atSet = AttributeSet::getByHandle('attribute_set_handle'); 
-$atKeys = $atSet->getAttributeKeys(); 
-  
-foreach($atKeys as $ak) { 
-  echo $ak->akName; 
-} 
- 
-(in controller.php) 
- 
-namespace 
-use \Concrete\Core\Attribute\Set as AttributeSet; 
- 
-$atSet = AttributeSet::getByHandle('attribute_set_handle'); 
-$atKeys = $atSet->getAttributeKeys(); 
-  
-foreach($atKeys as $ak) { 
-  $setNmes[] = $ak->akName; 
-} 
-</code> 
- 
- 
-{{wiki:v8.png?nolink}} 
-<code php> 
-(in view.php) 
-$atSet = AttributeSet::getByHandle('attribute_set_handle'); 
-$atKeys = $atSet->getAttributeKeys(); 
-  
-foreach($atKeys as $ak) { 
-  echo $ak->getAttributeKeyName(); 
-} 
- 
-(in controller.php) 
- 
-namespace 
-use \Concrete\Core\Attribute\Set as AttributeSet; 
- 
-$atSet = AttributeSet::getByHandle('attribute_set_handle'); 
-$atKeys = $atSet->getAttributeKeys(); 
-  
-foreach($atKeys as $ak) { 
-  $setNmes[] = $ak->getAttributeKeyName(); 
-} 
-</code> 
-===== Display/Get Options From a Select Attribute ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php  
-  Loader::model('attribute/type'); 
-  Loader::model('attribute/categories/collection'); 
-  
-  $ak = CollectionAttributeKey::getByHandle('attribute_handle'); 
-  $sa = new SelectAttributeTypeController(AttributeType::getByHandle('select')); 
-  $sa->setAttributeKey($ak); 
-  $values = $sa->getOptions(); 
- 
-  foreach ($values as $v) { 
-    echo $v->value; 
-  }  
-?>  
-</code> 
- 
-===== Display/Get Options From a Select Attribute ===== 
-{{wiki:c57.png?nolink}} 
- 
-<code php> 
-<?php  
-  use CollectionAttributeKey; 
-   
-  $ak = CollectionAttributeKey::getByHandle('attribute_handle'); 
-  if ( is_object($ak)) { 
-    $type = $ak->getAttributeType(); 
-    $controller = $type->getController(); 
-    $controller->setAttributeKey($ak); 
-    $options = $controller->getOptions(); 
-  
-    foreach($options as $option){ 
-      print $option . '<br/>'; 
-    } 
-  } 
- ?>  
-</code> 
-===== Display/Get multiple Values From a Select Page Attribute ===== 
-<code php> 
-<?php 
-Loader::model("attribute/categories/collection"); 
-  
-  $selectedOptions = $c->getCollectionAttributeValue('attribute_handle'); 
-  if (is_object($selectedOptions)) { 
-    foreach ($selectedOptions as $opt) { 
- echo $opt; 
-    } 
-  } 
-?>  
-</code> 
- 
-===== Add select attribute with attribute set ===== 
-<code php> 
-<?php  
-  // add select with attribute set page attributes  
-   
-  // Set attribute category  
-  $akCat = AttributeKeyCategory::getByHandle('collection'); 
-  $akCat->setAllowAttributeSets(AttributeKeyCategory::ASET_ALLOW_SINGLE); 
-  $akCatSet = $akCat->addSet('attribute_set_handle', t('Attribute Set Name'),$pkg); 
- 
-  $atType = AttributeType::getByHandle('select'); 
- 
-  // test for existing attribute 
-  $myAttribute = CollectionAttributeKey::getByHandle('attribute_handle');  
- 
-  // Add attribute 
-  if( !is_object($myAttribute) ) { 
-        
-    CollectionAttributeKey::add($atType,  
-    array('akHandle' => 'attribute_hande',  
-    'akName' => t('Attribute Name'),  
-    'akIsSearchable' => true,  
-    'akIsSearchableIndexed' => true, 
-    'akSelectAllowMultipleValues' => false, 
-    'akSelectAllowOtherValues' => false, 
-    'akSelectOptionDisplayOrder' => 'alpha_asc',  // alpha_asc or popularity_desc 
-    ),$pkg)->setAttributeSet($akCatSet);  
- 
-    //Add option values 
-    $myAttribute = CollectionAttributeKey::getByHandle('attribute_handle'); 
-    SelectAttributeTypeOption::add( $mMakerAttribute, 'Select Option One'); 
-    SelectAttributeTypeOption::add( $mMakerAttribute, 'Select Option Two'); 
-    SelectAttributeTypeOption::add( $mMakerAttribute, 'Select Option Three'); 
- } 
-?> 
-</code> 
- 
-=====  Select Nav Based On Page Attributes ===== 
-<code php> 
-(See language Switching) 
- 
-<?php 
-  if ($c->getCollectionAttributeValue('spanish_menus')) { 
-    $block = Block::getByName('Spanish Menus'); 
-    if( is_object($block) ) $block->display(); 
-  } else { 
-    $block = Block::getByName('English Menus'); 
-     if( is_object($block) ) $block->display(); 
-   } 
-?> 
-</code> 
- 
-====== Working With Users ====== 
- 
-===== Add a User Attribute Programmatically ===== 
-<code php> 
-<?php 
-  Loader::model('user_attributes'); 
-  //add boolean type user attribute  
-  $boolt = AttributeType::getByHandle('boolean'); 
-  $attributeHandle=UserAttributeKey::getByHandle('attribute_handle'); 
-  
-  if( !is_object($attributeHandle) ) 
-    UserAttributeKey::add($boolt, array('akHandle' => 'atribute_handle', 'akName' => t('Attribute name'), 'akIsSearchable' => false, 'uakProfileEdit' => false, 'uakRegisterEdit' => false, 'akCheckedByDefault' => false)); 
-} 
-?> 
-</code> 
- 
-===== Delete User Attribute Programmatically ===== 
-<code php> 
-<?php 
-  Loader::model('user_attributes'); 
-  $attributeHandle = UserAttributeKey::getByHandle('atribute_handle'); 
-   if( is_object($attributeHandle) ) 
-     $attributeHandle->delete(); 
-} 
-?> 
-</code> 
- 
-===== Get a User Attribute for Person Logged In ===== 
-<code php> 
-<?php 
-  $u = new User(); 
-  if($u->isLoggedIn()) { 
-    $ui = UserInfo::getByID($u->getUserID()); 
-    echo $ui->getAttribute('attribute_name');  
-} 
-?> 
-</code> 
- 
-===== Set a User Attribute for Person Logged In ===== 
-<code php> 
-<?php 
-  $u = new user(); 
-  $ui = UserInfo::getByID($u->getUserID()); 
-  $ui->setAttribute('attributenName', 'value'); 
-?> 
-</code> 
- 
-===== Delete a User Attribute ===== 
-<code php> 
-<?php 
-  Loader::model('user_attributes'); 
-  $attributeKey = UserAttributeKey::getByHandle('user_attribute_name'); 
-  if( is_object($attributeKey) ) 
-    $attributeKey->delete(); 
-?> 
-</code> 
- 
-===== Display/Get Options From a User Select Attribute ===== 
-<code php> 
-<?php 
-  Loader::model('attribute/type'); 
-  Loader::model('attribute/categories/user'); 
- 
-  $ak = UserAttributeKey::getByHandle('project_name'); 
-  $sa = new SelectAttributeTypeController(AttributeType::getByHandle('select')); 
-  $sa->setAttributeKey($ak); 
-  $values = $sa->getOptions(); 
- 
-  foreach ($values as $v) { 
-    echo $v->value; 
-  } 
-?> 
-</code> 
-===== Add a User To a Group ===== 
-<code php> 
-<?php 
-  $u = new User(); 
-  $u->getByUserID($uID); 
-  $groupName = Group::getByName('Name_Of_Your_Group'); 
-  $u->enterGroup($groupName); 
-?> 
-</code> 
- 
-===== Get All User Group Names ===== 
-<code php> 
-<?php 
-Loader::model('search/group'); 
- 
-$gl = new GroupSearch(); 
-$gResults = $gl->getPage(); 
-  
-foreach ($gResults as $g) { 
-  echo  $g['gName']; 
-} 
-?>  
-</code> 
- 
-===== Display a Users Name ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-  $u = new User(); 
-  echo $u->getUserName(); 
-?> 
-</code> 
-===== If Logged in Adjust Background Position ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php  
-  $u = new User(); 
-    
-  if ($u->isLoggedIn()) { ?> 
-    <style type="text/css"> 
-    body { background-position: 0px 49px; } 
-    </style> 
-<?php } ?> 
-</code> 
-===== If a User is Logged In Do Something ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-  $u = new User(); 
-  if($u->isLoggedIn()) { 
-    echo 'Hello '.$u->getUserName(); 
-  } 
-?> 
-</code> 
-===== If Logged in User is Admin Do Something ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-  $u = new user(); 
-  $g = Group::getByName('Administrators'); 
-  
-  if ($u->inGroup($g)||$u->isSuperUser()) { 
-    //do something here 
-  } 
-?> 
-</code> 
- 
-====== Working With Files and Sets ====== 
- 
-===== Get Path to File ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-  $f = File::getByID(FILE_ID); 
-  $fv = $f->getApprovedVersion(); 
-  $path = $fv->getRelativePath(); 
-?> 
-</code> 
-] 
-===== Get File Set Names ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-  Loader::model('file_set'); 
-  $fileSets = FileSet::getMySets(); 
-  foreach ($fileSets as $fs) { 
-    echo fs->getFileSetName(); 
-  } 
-?> 
- 
-$fs->getFileSetID() 
-$fs->getFileSetName() 
-$fs->getFileSetType() 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
-(in view.php) 
-<?php 
-  $fileSets = FileSet::getMySets(); 
-  foreach ($fileSets as $fs) { 
-    echo $fs->getFileSetName(); 
-  } 
-?> 
- 
-$fs->getFileSetID() 
-$fs->getFileSetName() 
-$fs->getFileSetType() 
- 
-(in controller.php 
- 
-<?php 
-namespace 
-use FileSet; 
-use FileList; 
- 
-  $fileSets = FileSet::getMySets(); 
-  foreach ($fileSets as $fs) { 
-   $filesets('id' => $fs->getFileSetID(), 'name' => $fs->getFileSetName()); 
- } 
-?> 
-</code> 
-===== Add a File Set ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-  Loader::model('file_set');    
-  $fs = FileSet::createAndGetSet('FILESET_NAME', FileSet::TYPE_PUBLIC, $uID = false); 
-?> 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
-<?php   
-  $fs = FileSet::createAndGetSet('FILESET_NAME', FileSet::TYPE_PUBLIC, $uID = false); 
-?> 
-</code> 
-===== Get File Attribute Value ===== 
-<code php> 
-<?php 
-  $f = File::getByID(FILE ID NUMBER); 
-  echo $f->getAttribute('Attrubute_name'); 
-?> 
-</code> 
-===== Add a File Attribute ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-  // add file attribute programmatically (text) 
-  Loader::model('file_attributes'); 
-  $textt = AttributeType::getByHandle('text'); 
-  $attribute=FileAttributeKey::getByHandle('attribute_handle');     
-  
-  if( !is_object($attribute) ) 
-    FileAttributeKey::add($textt, array('akHandle' => 'attribut_handle', 'akName' => t('Atribute Name'))); 
- 
- 
-  // when uploading with a form 
-  function action_file_upload() { 
-    Loader::library("file/importer"); 
-    $fi = new FileImporter(); 
-    $newFile = $fi->import($_FILES['fileName']['tmp_name'], 
-    $_FILES['fileName']['name']); 
-     
-   // add attriubute    
-   if($newFile instanceof FileVersion) { 
-     $f = $newFile->getFile(); 
-     $fv = $f->getApprovedVersion();  
-     $fv->setAttribute('ATTRIBUTE_NAME', 'VALUE'); 
-   } 
-} 
-?> 
-</code> 
- 
-{{wiki:c57.png?nolink}} 
-<code php> 
-<?php 
-// in a package 
-use Concrete\Core\Attribute\Key\CollectionKey as CollectionAttributeKey; 
-use \Concrete\Core\Attribute\Type as AttributeType; 
- 
-$attribute = CollectionAttributeKey::getByHandle('my_attribute'); 
-if ( !is_object($attribute)) { 
-  $att = AttributeType::getByHandle('select'); 
-  // add attribute  
-  CollectionAttributeKey::add($att, array('akHandle' => 'my_attribute',  
-    'akName' => t('My Attribute'),  
-    'akIsSearchableIndexed' => true,  
-    'akIsSearchable' => true,  
-    'akSelectAllowMultipleValues' => true,  
-    'akSelectAllowOtherValues' => true,  
-    'akSelectOptionDisplayOrder' => 'alpha_asc'),$pkg);  
- 
-  // or add to attribute and assign to an attribute set 
-  // CollectionAttributeKey::add($att, array('akHandle' => 'my_attribute',  
-  // 'akName' => t('My Attribute'),  
-  // 'akIsSearchableIndexed' => true,  
-  // 'akIsSearchable' => true,  
-  // 'akSelectAllowMultipleValues' => true,  
-  // 'akSelectAllowOtherValues' => true,  
-  // 'akSelectOptionDisplayOrder' => 'alpha_asc'),$pkg)->setAttributeSet($akCatSet);  
-  $addAttribute = CollectionAttributeKey::getByHandle('my_attribute'); 
-} 
-</code> 
- 
-===== Add a File Attribute Set===== 
-{{wiki:c57.png?nolink}} 
-<code php> 
-<?php 
-  use \Concrete\Core\Attribute\Key\Category as AttributeKeyCategory; 
- 
-  $akCat = AttributeKeyCategory::getByHandle('collection'); 
-  $akCat->setAllowAttributeSets(AttributeKeyCategory::ASET_ALLOW_SINGLE); 
-  $akCatSet = $akCat->addSet('my_attribute_set', t('My Attribute Set'),$pkg); 
-</code> 
- 
-===== Display / Get File Info from File Sets===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-  Loader::model("file_set"); 
-  Loader::model('file_list'); 
- 
-  $fs = FileSet::getByName('Your File Set'); 
-  $fl = new FileList(); 
-  $fl->filterBySet($fs); 
-  $fl->sortBy('fsDisplayOrder', 'asc'); 
-  $files = $fl->get(); 
- 
-  foreach($files as $f) { 
-    echo $f->getFileName(); 
-    echo $f->getTitle();  
-    echo $f->getAttribute("width"); 
-    echo $f->getDownloadURL(); 
-    echo $f->getRelativePath(); 
-    echo $f->getDescription(); 
-    echo $f->getAttribute('attribute_name')  
-  } 
-?> 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
-(in view.php) 
-<?php 
-  $fs = FileSet::getByName('Your File Set'); 
-  $fl = new FileList(); 
-  $fl->filterBySet($fs); 
-  $fl->sortBy('fsDisplayOrder', 'asc'); 
-  $files = $fl->get(); 
-  
-  foreach($files as $f) { 
-    echo $f->getFileName(); 
-    echo $f->getTitle();  
-    echo $f->getAttribute("width"); 
-    echo $f->getDownloadURL(); 
-    echo $f->getRelativePath(); 
-    echo $f->getDescription(); 
-    echo $f->getAttribute('attribute_name'); 
-  } 
-?> 
- 
-(in controller.php) 
-<?php 
-namespace 
-use FileSet; 
-use FileList; 
- 
-  $fs = FileSet::getByName('Your File Set'); 
-  $fl = new FileList(); 
-  $fl->filterBySet($fs); 
-  $fl->sortBy('fsDisplayOrder', 'asc'); 
-  $files = $fl->get(); 
-?>   
-</code> 
-===== Add a File  ===== 
-<code php> 
-<?php 
-    Loader::library("file/importer"); 
-    $fi = new FileImporter(); 
-    $newFile = $fi->import($pathToFile, $nameOfFile, $fileObject); 
-  } 
-?> 
-</code> 
- 
-===== Add a File From a Form ===== 
-<code php> 
-<?php 
-  // function in controller 
-  function action_file_upload() {  
-    Loader::library("file/importer"); 
-    $fi = new FileImporter(); 
-    $newFile = $fi->import($_FILES['fileName']['tmp_name'], 
-    $_FILES['fileName']['name']); 
-  } 
-?> 
-</code> 
- 
-===== Add a File to a file Set ===== 
-<code php> 
-<?php 
-  // when uploading with a form 
-  function action_file_upload() { 
-    Loader::library("file/importer"); 
-    $fi = new FileImporter(); 
-    $newFile = $fi->import($_FILES['fileName']['tmp_name'], 
-    $_FILES['fileName']['name']); 
- 
-    // add file to file set  
-    Loader::model('file_set'); 
-    $fs = FileSet::createAndGetSet('FILE_SET_NAME', FileSet::TYPE_PUBLIC,  
-    $uID = false); 
-    $fsf = $fs->addFileToSet($newFile);  
-  } 
-?> 
-</code> 
- 
-====== Working With Page Lists ====== 
- 
-===== Initiating a Page List ===== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-  Loader::model('page_list'); 
-   
-  $pl = new PageList(); 
-   
-    ... Filtering and Sorting Options ... 
-   
-   // Get the page List Results  
-  $pages = $pl->getPage() Get all pages that match filter/sort criteria. 
- 
-  Or 
-   
-  $pages = $pl->get($itemsToGet = 100, $offset = 0) Get pages (taking into account $itemsPerPage, current page, etc...) 
-?> 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
- 
-(in view.php) 
- 
-<?php 
-  $pl = Core::Make('PageList');  
-   
-  $pl = new PageList(); 
-   
-    ... Filtering and Sorting Options ... 
-   
-   // Get the page List Results  
-  $pages = $pl->get() Get all pages that match filter/sort criteria. 
-?> 
- 
-(in controller.php) 
- 
-<?php 
-namespace 
-use Concrete\Core\Page\PageList; 
- 
-  $pl = new PageList(); 
-   
-    ... Filtering and Sorting Options ... 
-   
-   // Get the page List Results  
-  $pages = $pl->get() Get all pages that match filter/sort criteria. 
-?> 
-</code> 
-===== Page List Filters / Sorting ===== 
-{{wiki:c567.png?nolink}} 
-<code php> 
-<?php 
-  // Available Filters 
-  $pl->ignorePermissions(); // Don't check the permissions of the logged-in user. 
-  $pl->ignoreAliases(); // Ignore aliased pages. 
-  $pl->includeSystemPages(); // Include system pages 
-  $pl->displayUnapprovedPages(); // Include pages that have not been approved. 
-  $pl->filterByKeywords($keywords); // Filters files by keywords. 
-  $pl->filterByName($name, $exact = false); // Filter page name. 
-  $pl->filterByPath($path, $includeAllChildren = true); // Filters pages by path, children true/false 
-  $pl->filterByParentID($cParentID); //Filters by the parent ID. 
-  $pl->filterByCollectionTypeID($ctID); //Displays pages of a certain page type. 
-  $pl->filterByUserID($userID); //Displays pages owned by a particular user ID. 
-  $pl->filterByIsApproved($isApproved); //Only display approved pages. 
-  $pl->filterByIsAlias($ia); //Filters by whether an item is an alias or not. 
-  $pl->filterByCollectionTypeHandle($ctHandle); //Filters by page type handles. $ctHandle can be array of page type handles. 
-  $pl->filterByDateAdded($date, $comparison = '='); //Filters by date the page was added. $comparison can be any MySQL comparison operator. 
-  $pl->filterByPublicDate($date, $comparison = '='); //Filters by public date. $comparison can be any MySQL comparison operator. 
-  $pl->filterByDateLastModified($date, $comparison = '='); //Filters by date the page was last modified. $comparison can be any MySQL comparison operator. 
-  $pl->filterByNumberOfChildren($number, $comparison = '='); //Filters by number of page children. $comparison can be any MySQL comparison operator. 
-  $pl->filterByAttribute($attributeKeyHandle, $value, $comparison); //Filters by attribute. 
-  $pl->filter($column, $value, $comparison); //Filter by MySql "WHERE" clause 
- 
-  // Sorting Options 
-  $pl->sortByRelevance(); //Orders by index score descending. Only available when searching by keywords. 
-  $pl->sortByDisplayOrder(); //Orders by sitemap display order ascending. 
-  $pl->sortByDisplayOrderDescending(); // Orders by sitemap display order descending. 
-  $pl->sortByPublicDate(); //Orders by public date ascending. 
-  $pl->sortByPublicDateDescending(); //Orders by public date descending. 
-  $pl->sortByName(); //Orders by page name ascending. 
-  $pl->sortByNameDescending(); // Order by name descending 
-  $pl->sortBy('ak_ATTRIBUTE_HANDLE'); // Order by a page attribute 
-?> 
-</code> 
- 
-=== Get Page List based on Collection Type Handle ===  
-<code php> 
-<?php 
-  $pl = new PageList(); 
-  $pl->filterByCollectionTypeHandle('COLLECTION_HANDLE'); 
-  $pl->sortByDisplayOrder('alpha_asc'); // Sort alphebetically 
-   
-  $pages = $pl->getPage(); 
-   
-  // Display Page Name and Description 
-  foreach ($pages as $page){ 
-    echo $page->getCollectionName(); 
-    echo $page->getCollectionDescription(); 
-  } 
-?> 
-</code> 
-===== Embed Page List Block in Theme =====   
-<code php> 
-<?php 
-  $bt = BlockType::getByHandle('page_list'); 
-   
-  //Set Options 
-  $bt->controller->orderBy = 'display_asc'; // 'display_asc', 'chrono_desc', 'chrono_asc', 'alpha_asc', 'alpha_desc' 
-  $bt->controller->ctID = ''; // Filter by Collection Page Type ID 
-  $bt->controller->displayFeaturedOnly = 'false'; // If Featured Page attribute 'true', 'false'  
-  $bt->controller->displayAliases = 'false'; // Display aliase pages 'true', 'false' 
-  $bt->controller->paginate = 'true'; // 'true', 'false' 
-  $bt->controller->cParentID = '6149'; // Display pages beneath this page ID 
-  $bt->controller->includeAllDescendents = 'true'; // 'true', 'false'  
-  $bt->controller->orderBy = 'display_asc'; // 'display_asc', 'chrono_desc', 'chrono_asc', 'alpha_asc', 'alpha_desc' 
-  $bt->controller->showrss = 'false'; // Display RSS feed 'true', 'false' 
-  $bt->controller->truncateSummaries = 'true'; // 'true', 'false' 
-  $bt->controller->truncateChars = '128'; // Truncate length if summaries 'true' 
-  $bt->controller->paginate = 'true'; // 'true', 'false' 
-   
-  // Render the block 
-  $bt->render('view'); // for template 'templates/template_name' 
-?> 
-</code> 
-===== Re-Sort Page List Block $pages Array =====   
-<code php> 
-<?php 
-  // Re-sort in view.php by an end date page attribute 
-  usort($pages, create_function('$a, $b', 'return $a->getAttribute("end_date") > $b->getAttribute("end_date");')); 
-?> 
-</code> 
- 
-====== Controllers ====== 
- 
-===== Single Page Controllers ===== 
-{{wiki:c57.png?nolink}} 
-<code php> 
-Create single page file: applications/single_pages/test_page.php 
- 
-Create a controller file: applications/controllers/test_page.php  
- 
-Namespace and class for controller 
- 
-<?php  
-namespace Application\Controller\SinglePage; 
-use PageController; 
- 
-class TestPage extends PageController 
-{ 
- 
-    // Add functions 
-    public function view() 
-    { 
-        // Whatever code you need for functions 
-        echo 'Hello World'; 
-    } 
-     
-} 
-?> 
-</code> 
-   
-====== Database ====== 
- 
-===== Fetch Data From Database ===== 
-<code php> 
-<?php 
-  $db = Loader::db(); 
-  
-  $sql = "SELECT * FROM [table] WHERE [column1] = ? AND [column2] = ?"; 
-  $vals = array('[value1]', '[value2]'); 
-  $r = $db->Execute($sql, $vals); 
-  $row = $r->FetchRow(); 
-  
-  echo $row[column name]; 
-?> 
-</code> 
- 
-===== Update Database ===== 
-<code php> 
-<?php  
-  $db = Loader::db(); 
- 
-  $sql = "UPDATE [table] SET [column] = ? WHERE bID = $this->bID"; 
-  $vals = array('[value]'); 
-  $update = $db->Execute($sql, $vals); 
-?> 
-</code> 
- 
-====== Helpers ====== 
- 
-===== Date/Time Helper ===== 
- 
-==== Load Date/Time Helper ==== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-$date = Loader::helper("date"); 
-?> 
-</code> 
-{{wiki:c57.png?nolink}} 
-<code php> 
-<?php 
-$date = Core::make('helper/date'); 
-?> 
-</code> 
-==== Compare Today's Date With a Pages Date/Time Attribute (end_date) And Do Something ==== 
-<code php> 
-Using Date Helper to format ($mask=) display of date and time. 
- 
-<?php 
-   
-  if($date->getSystemDateTime($c->getCollectionAttributeValue('end_date'), $mask = 'd-m-Y G:i') > $date->getLocalDateTime('now',$mask = 'd-m-Y G:i')) { 
-    echo 'End date is greater than today'; 
-  } 
-?> 
-</code> 
- 
-==== Display Date/Time In dd-mm-yyyy 00:00 Format. ==== 
-<code php> 
-<?php 
-  $date = Loader::helper("date");  echo $date->getLocalDateTime('now',$mask = 'd-m-Y G:i') 
-?> 
-</code> 
- 
-==== Display Page Attribute "end_date" In mm/dd/yy Format ==== 
-<code php> 
-<?php 
-  echo $date->getSystemDateTime($c->getCollectionAttributeValue('end_date'), $mask = 'm/d/y')  
-?> 
-</code> 
- 
-==== Get Date The Page Was Last Edited ==== 
-<code php> 
-<?php 
-  foreach($c->getBlocks('Main') as $b) { 
-    $bDate[$i] = $b->getBlockDateLastModified(); 
-    $i ++; 
-  } 
-   
-  rsort( $bDate ); 
-   
-  echo $date->getLocalDateTime($bDate[0],$mask = 'm-d-Y g:i:s'); 
-?> 
-</code> 
- 
-==== If Page Attribute "end_date Is Greater Than Current Time, Do Something. ==== 
-<code php> 
-<?php 
-  if($date->getSystemDateTime($c->getCollectionAttributeValue('end_date'), $mask = 'd-m-Y G:i') > $date->getLocalDateTime('now',$mask = 'd-m-Y G:i')) { 
- 
-    [do something here] 
- 
-  } 
-?> 
-</code> 
- 
-==== PHP Date Formatting For Mask ==== 
-<code php> 
-a 'am' or 'pm' 
-A 'AM' or 'PM' 
-B Swatch Internet time 
-d day of the month, 2 digits with leading zeros; i.e. '01' to '31' 
-D day of the week, textual, 3 letters; i.e. 'Fri' 
-F month, textual, long; i.e. 'January' 
-g hour, 12-hour format without leading zeros; i.e. '1' to '12' 
-G hour, 24-hour format without leading zeros; i.e. '0' to '23' 
-h hour, 12-hour format; i.e. '01' to '12' 
-H hour, 24-hour format; i.e. '00' to '23' 
-i minutes; i.e. '00' to '59' 
-I (capital i) '1' if Daylight Savings Time, '0' otherwise. 
-j day of the month without leading zeros; i.e. '1' to '31' 
-l (lowercase 'L') day of the week, textual, long; i.e. 'Friday' 
-L boolean for whether it is a leap year; i.e. '0' or '1' 
-m month; i.e. '01' to '12' 
-M month, textual, 3 letters; i.e. 'Jan' 
-n month without leading zeros; i.e. '1' to '12' 
-r RFC 822 formatted date; i.e. 'Thu, 21 Dec 2000 16:01:07 +0200' (added in PHP 4.0.4) 
-s seconds; i.e. '00' to '59' 
-S English ordinal suffix, textual, 2 characters; i.e. 'th', 'nd' 
-t number of days in the given month; i.e. '28' to '31' 
-T Timezone setting of this machine; i.e. 'MDT' 
-U seconds since the epoch 
-w day of the week, numeric, i.e. '0' (Sunday) to '6' (Saturday) 
-Y year, 4 digits; i.e. '1999' 
-y year, 2 digits; i.e. '99' 
-z day of the year; i.e. '0' to '365' 
-Z timezone offset in seconds (i.e. '-43200' to '43200'). The offset for timezones west of UTC is always negative, and for those east of UTC is always positive. 
-</code> 
-===== Image Helper ===== 
- 
-==== Load Image Helper ==== 
-{{wiki:c56.png?nolink}} 
-<code php> 
-<?php 
-  $imageHelper = Loader::Helper('image'); 
-?> 
-</code> 
-{{wiki:c57.png?nolink}} (depricated) 
-<code php> 
-<?php 
-  $imageHelper = Core::make('helper/image'); 
-?> 
-</code> 
-==== Output Thumbnail from Page Attribute ==== 
-<code php> 
-If image exists in Image/File Attribute "product_image", display the image scaled to 100px. 
- 
-<?php 
-  if($c->getAttribute('product_image')) { 
-    $imageHelper->outputThumbnail($c->getAttribute('product_image'),100 ,100); 
-  } 
-?> 
-</code> 
- 
-==== Get Thumbnail Info with Image Helper ==== 
-<code php> 
-<?php 
-  $file = File::getByID(id_number); 
-  $img = $imageHelper->getThumbnail($file, 100, 100); 
-?>  
- 
-<img src="<?php echo $img->src; ?>" width="<?php echo $img->width; ?>" height="<?php echo $img->height; ?>"> 
-</code> 
- 
-===== Multilingual Helper ===== 
- 
-==== Load Multilingual Helper ==== 
-<code php> 
-<?php 
-  $lh = Loader::helper('section', 'multilingual'); 
-<? 
-</code> 
- 
-==== Return Two Language Code ==== 
-<code php> 
-<?php 
-  $lh = Loader::helper('section', 'multilingual'); 
-  echo $lh->getLanguage(); 
-?> 
-</code> 
- 
-===== Site.php ===== 
- 
-==== Common Settings ==== 
-<code php> 
-Set advanced permissions on 
-  define('PERMISSIONS_MODEL', 'advanced'); 
-  
-Use APC Caching (you need APC installed) 
-  define('CACHE_LIBRARY', 'apc'); 
-  
-Disable Zend Cache Cleaning (may improve performance) 
-  define('CACHE_FRONTEND_OPTIONS', 
-  serialize(array('automatic_cleaning_factor' => 0))); 
-  
-Set time to 24 hour format 
-  define('DATE_FORM_HELPER_FORMAT_HOUR', '24'); 
-  
-Date Formatting 
-  define('DATE_APP_GENERIC_MDYT_FULL', 'F d, Y \a\t g:i A'); 
-  define('DATE_APP_GENERIC_MDYT', 'n/j/Y \a\t g:i A'); 
-  define('DATE_APP_GENERIC_MDY', 'n/j/Y'); 
-  define('DATE_APP_GENERIC_MDY_FULL', 'F d, Y'); 
-  
-Change minimum user name length from default value 3 
-  define('USER_USERNAME_MINIMUM', 3); 
-  
-Change maximum username length from default value 64 
-  define('USER_USERNAME_MAXIMUM', 64); 
-  
-Change minimum password length from default value 3 
-  define('USER_PASSWORD_MINIMUM', 5); 
-  
-Change maximum password length from default value 64 
-  define('USER_PASSWORD_MAXIMUM', 64); 
-  
-Change session time from default of 2 hours 
-  define('SESSION_MAX_LIFETIME', 7200); // 2 hours 
-  
-Set registration email notification address 
-  define('EMAIL_ADDRESS_REGISTER_NOTIFICATION', 
-  'example@domain.com'); 
-  
-Set registration email notification from address 
-  define('EMAIL_ADDRESS_REGISTER_NOTIFICATION_FROM', 
-  'example@domain.com'); 
-</code> 
-  
-==== White Label Configuration ==== 
-<code php> 
-Disable concrete5 marketplace integration. 
-define('ENABLE_MARKETPLACE_SUPPORT', false);  
-  
-Disable help searches in the intelligent search. 
-define('ENABLE_INTELLIGENT_SEARCH_HELP', false); 
-  
-Disable marketplace add-ons appear in intelligent  
-search results.  
-define('ENABLE_INTELLIGENT_SEARCH_MARKETPLACE', false);  
-  
-Disable newsflow 
-define('ENABLE_NEWSFLOW_OVERLAY', false); 
-  
-Path to the logo image. This can also be a full URL.  
-This file should be 49x49 pixels. 
-define('WHITE_LABEL_LOGO_SRC', 'PATH TO FILE');  
-  
-Alt text for the logo 
-define('WHITE_LABEL_APP_NAME', 'TEXT'); 
-  
-Disable Layouts. 
-define('ENABLE_AREA_LAYOUTS', false);  
-  
-Disable Custom Design for blocks or areas. 
-define('ENABLE_CUSTOM_DESIGN', false); 
-  
-Disable Newsflow connect to concrete5.org to retrieve  
-latest updates.  
-define('ENABLE_APP_NEWS', false);  
-  
-Set to a valid image (either local or a remote URL), or none. 
-define('WHITE_LABEL_DASHBOARD_BACKGROUND_SRC', 'none'); 
-  
-Web address for today's Image 
-define('WHITE_LABEL_DASHBOARD_BACKGROUND_FEED', false);  
-</code> 
- 
-Credits: https://thehub.net/cheatsheet/doku.php?id=cheatsheet 
  • info/concrete5/cheatsheet_concretecms.1758251215.txt.gz
  • Dernière modification : 2025/09/19 05:06
  • de radeff