NAVIGATION
This shows you the differences between two versions of the page.
|
deutsch:ersetzer_rts:frontend_init:cp_trigger:cp-bilder-title-ausgabe [2011/09/24 10:42] Knut Heermann (flip-flop) created |
deutsch:ersetzer_rts:frontend_init:cp_trigger:cp-bilder-title-ausgabe [2018/06/03 18:09] (current) |
||
|---|---|---|---|
| Line 4: | Line 4: | ||
| Mit diesem kleinen Script kann der {TITLE} TAG innerhalb %%<!--IMAGES_ENTRY_START//--> ......... <!--IMAGES_ENTRY_END//-->%% im CP-Template ersetzt werden. | Mit diesem kleinen Script kann der {TITLE} TAG innerhalb %%<!--IMAGES_ENTRY_START//--> ......... <!--IMAGES_ENTRY_END//-->%% im CP-Template ersetzt werden. | ||
| + | |||
| + | ===== TAGs: ===== | ||
| + | |||
| + | * **CP Titel:** ##%% [[%TITLE%]] %%## | ||
| + | * **Bild title:** ##%% [[%{IMGID}::TITLE%]] %%## | ||
| Line 53: | Line 58: | ||
| // dumpVar($text); | // dumpVar($text); | ||
| - | // --- Title from caption title ------------------------ | + | // --- Title from caption title ------------------------ |
| + | |||
| + | $image = @unserialize($data["acontent_form"]); | ||
| + | |||
| + | foreach($image['images'] as $key => $value) { | ||
| + | |||
| + | $caption[$key] = getImageCaption($image['images'][$key][6]); | ||
| + | |||
| + | // [[%Count::TITLE%]] title aus Bildunterzeile einsetzen | ||
| + | $text = preg_replace('/\[\[%'.$key.'::TITLE%\]\]/is', $caption[$key][3], $text); | ||
| + | } | ||
| + | // ----------------------------------------------------- | ||
| - | $image = @unserialize($data["acontent_form"]); | + | // dumpVar($caption); |
| - | foreach($image['images'] as $key => $value) { | + | // --- Title from CP title ----------------------------- |
| - | + | // [[%TITLE%]] Title einsetzen | |
| - | $caption[$key] = getImageCaption($image['images'][$key][6]); | + | |
| - | // [[%Count::........%]] title aus Bildunterzeile einsetzen | + | $text = str_replace('[[%TITLE%]]', $data[acontent_title], $text); |
| - | $text = preg_replace('/\[\[%'.$key.'::(.*?)%\]\]/is', $caption[$key][3], $text); | + | |
| - | } | + | // --- Title from caption title ------------------------ |
| - | // ----------------------------------------------------- | + | |
| - | + | ||
| - | // dumpVar($caption); | + | |
| - | + | ||
| - | // --- Title from CP title ----------------------------- | + | |
| - | // [[%........%]] Title einsetzen | + | |
| - | + | ||
| - | // $text = preg_replace('/\[\[%(.*?)%\]\]/is', $data[acontent_title], $text); | + | |
| - | // --- Title from caption title ------------------------ | ||
| - | |||
| } | } | ||
| return $text; | return $text; | ||
| } | } | ||
| + | |||
| register_cp_trigger('CP_IMGDIV_TAG01'); | register_cp_trigger('CP_IMGDIV_TAG01'); | ||
| ?> | ?> | ||
| </code> | </code> | ||
| + | |||
| + | \\ | ||
| + | |||
| + | ===== Beispiel: ===== | ||
| + | |||
| + | <code html> | ||
| + | <!--IMAGES_ENTRY_START//--> | ||
| + | <div style="padding:0px;border:0px solid #CCCCCC;margin:0px 0px 0 0;"> | ||
| + | [TITLE]<h3>[[%TITLE%]]</h3>[/TITLE] | ||
| + | [TITLE]<h3>[[%{IMGID}::TITLE%]]</h3>[/TITLE] | ||
| + | |||
| + | [SUBTITLE]<h4>{SUBTITLE}</h4>[/SUBTITLE] | ||
| + | </div> | ||
| + | ..... | ||
| + | ..... | ||
| + | <!--IMAGES_ENTRY_END//--> | ||
| + | </code> | ||
| + | |||
| + | |||
| \\ | \\ | ||