{{indexmenu_n>20}} ====== One thumb - several largesize ====== ===== The problem: ===== In CP images special only the first thumb of all is to be displayed. All large pictures should be visible in the LightBox using (next/prev). \\ ===== Frontend: ===== Only the first thumb is visible, all other are hidden. {{:deutsch:phpwcms-system:artikel:contentparts:bilder-spezial:one_thumb_several_largesize_fe_de_1.gif|}} \\ ==== Solution V1: ==== **Up to version 1.4.5 r401** The Thumbs is laid on top of each other simply with **positon: absolute;**. - The Thumbs is laid on top of each other simply with **positon: absolute;**. - Now still a index //(z-index)// is missing, so that really the first Thumb stands above. - In addition a small CP-trigger can be used. ==== Solution V2: ==== **Up to version 1.4.5 r401** **//(Preset in CP-Trigger)//** - The thumbs are marked with ** display: none; ** to hidden. - Using a small CP-trigger we **display: block;** to the first Thumb. \\ ==== Solution V3: ==== **Since version 1.4.6 r402** with all patches, see download docu "[[http://www.phpwcms-docu.de/download-dev-versionen.phtml|DEV - Versionen im ZIP Format]]". Forum: [[http://forum.phpwcms.org/viewtopic.php?p=125981#p125981|Bilder einfügen mit nur 1 Vorschaubild]] Place in template from the CP in the surrounding container into a style statement: [PHP]if ('{FIRST}' == '') echo 'display: none;';[/PHP] "display: none" is set for all
enclosing container, except the first. **E.g. in a "Images special" template:**
{IMAGE} [CAPTION]

{CAPTION}

[/CAPTION][CAPTION_ELSE]

{IMGNAME}

[/CAPTION_ELSE] [INFOTEXT] {INFOTEXT} [/INFOTEXT] [INFOHTML] {INFOHTML} [/INFOHTML]
The number of columns in BE must be at least as large as the number of images, since the ID **%%(FIRST) = %% ** will be placed on a column top. There are no more scripts needed. \\ ~~UP~~ ===== Backend: ===== {{:deutsch:phpwcms-system:artikel:contentparts:bilder-spezial:one_thumb_several_largesize_be_de_1.gif|}} \\ ~~UP~~ ===== Template V1: ===== **Up to version 1.4.5 r401** Create the file ##/template/inc_cntpart/imagespecial/one_thumb_several_largesize.tmpl## and put into the code below. \\ - After a reload of the CP this template will appear in the select list and you can selectable. [TITLE]

{TITLE}

[/TITLE] [SUBTITLE]

{SUBTITLE}

[/SUBTITLE] [TEXT]{TEXT}[/TEXT]
{IMAGE}
\\ ===== Template V2: ===== **Up to version 1.4.5 r401** Create the file ##/template/inc_cntpart/imagespecial/one_thumb_several_largesize.tmpl## and put into the code below. \\ - After a renewed call to the CP this template will appear in the select list and you can selectable. [TITLE]

{TITLE}

[/TITLE] [SUBTITLE]

{SUBTITLE}

[/SUBTITLE] [TEXT]{TEXT}[/TEXT]
\\ ===== CP-Trigger ===== **Up to version 1.4.5 r401** Create the file ##/template/inc_Script/frontend_init/cp_trig_images_special.php## and put into the code below. Please comment out the appropriate line, depending on the version //(V1/V2)//. Version 2 is preset //(V2)//. ':block;" id="img0' */ /* Only the first occurence is replaced ----------- */ function str_replace_once($needle , $replace , $haystack){ // Looks for the first occurence of $needle in $haystack // and replaces it with $replace. $pos = strpos($haystack, $needle); if ($pos === false) { // Nothing found return $haystack; } return substr_replace($haystack, $replace, $pos, strlen($needle)); } // V1: Sucht im CP Image Special nach 'z-index:550' und ersetzt durch 'z-index:999' // V2: Sucht im CP Image Special nach 'style="display:none;" id="img0' // und ersetzt mit 'style="display:block;" id="img0' // -------------------------------------------------------------------------------- function CP_IMAGES_SPECIAL($text, & $data) { if( ($data['acontent_type'] == 31) AND // 31 is CP imgagesspecial (strpos($text, '') != false) ) // Ist es das richtige Template? { // $text = str_replace('z-index:550','z-index:999', $text); // V1 $text = str_replace_once(':none;" id="img0' , ':block;" id="img0' , $text); // V2 } return $text; } register_cp_trigger('CP_IMAGES_SPECIAL'); ?>