{{indexmenu_n>60}} ====== CP as standard selection ====== With this hack, a content part are defined in the BE as the default choice in the list, the focus //(selected)// lies in the selection of the registered CP. \\ ===== Necessary preparations ===== - as there are: - enter the switch **$phpwcms['custom_cp_select'] = CP-No;** in conf.inc.php - The file **include/inc_lib/backend.functions.inc.php** has to be changed a little bit //(small hack)// \\ ---- Docu: -- \\ Forum: [[http://forum.phpwcms.org/viewtopic.php?f=16&p=125967|Default Content Part?]] **Author:** K.Heermann (flip-flop) http://planmatrix.de \\ //(17.08.2010)// **CMS Version:** >= 1.4 \\ **Version:** V1.0 \\ **filename:** * include/inc_lib/backend.functions.inc.php * config/phpwcms/conf.inc.php ---- \\ ==== conf.inc.php ==== This switch determines whether and which content is marked as "selected". //(If the switche is not present it is the same like "" = off, the default state of the system is generated)//. In config/phpwcms/conf.inc.php you'll enter e.g. for the cp "images = No 2" $phpwcms['custom_cp_select'] = 2; // set selected cp no, list in "include/inc_lib/article.contenttype.inc.php" - default = '' - +KH170810 **See the numbers of the [[english/technics/internal-function-call/content-part-types]].** \\ ==== Code snippet (hack) ==== Enhancement of the file **include/inc_lib/backend.functions.inc.php** in function "getContentPartOptionTag" around line 454. **This code:** } else { $result .= ' **will be replaced by** \\ } else { // ------ +KH 17.08.2010 Patch: set selected cp no if ($selected === '' AND isset($GLOBALS['phpwcms']['custom_cp_select'])) $selected = $GLOBALS['phpwcms']['custom_cp_select']; // ------ +KH end $result .= ' \\