hallo Liste,
ich habe folgendes Problem und es macht mich ganz verrückt:
ich hab eine Extension zusammengeschraubt, Frontend-Plugin Typ Textbox. (effekt: das bild soll einen schatten bekommen - imagemagick läuft nicht allzu toll auf dem Server, deswegen bin ich auf sowas ausgewichen)
die Extension soll folgenden code ausspucken:
<div class="schattenbilder-block">
<table border="0" cellpadding="0" cellspacing="0" class="einschattenbild"><tr><td class="schatten-bild"><img src="uploads/pics/DSC03051.JPG" width="1200" height="1600" border="0" alt="" title="" /><!-- das hier ist das bild - ></td><td class="schatten-rechts"><img src="clear.gif" width="10" height="10" alt="spacer"></td></tr><tr><td class="schatten-unten"><img src="clear.gif" width="10" height="10"></td><td class="schatten-untenrechts"><img src="clear.gif" width="10" height="10" alt="spacer"></td></tr></table>
<p class="bodytext">den bodytext</p>
<div class="link"><p class="bodytext">hier einen Link, wenn ich einen eingebe</p></div>
</div>
plus ein paar _CSS_DEFAULT_STYLEs.
lokal gebaut und getestet(3.5.0), alles prima, backup gezogen, in die online-installation (3.5.0) reingeholt und dort installiert.
die extension ist (wie erwartet) im object-browser aufgetaucht, ich hab sie gleich ausprobiert und: im Frontend nimmt typo3 nicht meine Userfunktion, sondern den code von der default-textbox:
<TABLE border=0 cellspacing=0 cellpadding=0><tr><td valign=top><img src="typo3temp/10c6581108.jpg" width="100" height="75" border="0"></td><td><img src="clear.gif" height=1 width=30></td><td valign=top><P>der text vom bodytext-feld</P></td></tr></TABLE>
😢
naja, da hab ich noch eine andere lokale Installation (4.0) ausprobiert. die gibt "unten" den Korrekten html-code aus, lässt aber die default-styles weg. (wäre halb so wild, und vielleicht wirds noch in der nächsten halben Stunde, aber seltsam find ichs trotzdem)
das dumme ist, daß die onlineinstallation recht gut besucht wird, ich da also nicht wirklich viel testen kann. online laufen ähnliche textboxen korrekt.
zur Sicherheit:
extension-php-code:
function main($content,$conf) {
$this->conf=$conf;
// Processes the image-field content:
// $conf["IMAGEcObject."] is passed to the getImage() function as TypoScript
// configuration for the image (except filename which is set automatically here)
$imageFiles = explode(",",$this->cObj->data["image"]); // This returns an array with image-filenames, if many
$imageRows=array(); // Accumulates the images
reset($imageFiles);
while(list(,$iFile)=each($imageFiles)) {
$imageRows[] = $this->getImage($iFile);
}
$imageBlock = count($imageRows)?''.implode("",$imageRows).'':' ';
// Sets link and bodytext
$bodyTextTSconf = $this->conf['bodytext.'];
$bodyText = $this->cObj->TEXT($bodyTextTSconf);
$linkTSconf = $this->conf['link.'];
$linkTSconf['typolink.']['parameter'] = $this->cObj->data["image_link"];
$link = $this->cObj->TEXT($linkTSconf);
if (!isset ($link)){
$linkTSconf['wrap'] = ' | ';
$linkTSconf['value'] = ' ';
}
// And compiles everything into a table:
$finalContent = '<div class="schattenbilder-block">
'.$imageBlock.'
'.$bodyText.'
'.$link.'
</div>';
// And returns content
return $finalContent;
}
/**
* This calls a function in the TypoScript API which will return an image tag with the image
* processed according to the parsed TypoScript content in the $TSconf array.
*/
function getImage($filename) {
list($theImage)=explode(",",$filename);
//$imageTSconf = $this->conf['image.'];
$this->conf['image.']['file'] = "uploads/pics/".$theImage;
$img = $this->cObj->IMAGE($this->conf['image.']);
return $img;
}
extension typoscript-setup
plugin.user_schattenbox06_pi1 {
bodytext = TEXT
bodytext {
field = bodytext
br = 1
wrap = <p class="bodytext">|</p>
parseFunc {
makelinks = 1
tags.link = TEXT
tags.link{
current = 1
typolink.extTarget = _blank
typolink.target =
typolink.parameter.data = parameters : allParams
}
}
}
link{
typolink.parameter.data.field = image_link
wrap = <div class="link"><p class="bodytext">|</p></div>
}
image = IMAGE
image.file.maxW.field = imagewidth
image.wrap = <table border="0" cellpadding="0" cellspacing="0" class="einschattenbild"><tr><td class="schatten-bild">|</td><td class="schatten-rechts"><img src="clear.gif" width="10" height="10" alt="spacer"></td></tr><tr><td class="schatten-unten"><img src="clear.gif" width="10" height="10"></td><td class="schatten-untenrechts"><img src="clear.gif" width="10" height="10" alt="spacer"></td></tr></table>
_CSS_DEFAULT_STYLE (
table.einschattenbild {width:80px;}
td.schatten-bild { width: 10px;}
td.schatten-bild img {border: 1px solid rgb(80,87,103);}
td.schatten-rechts { background:url(typo3conf/ext/user_schattenbox06/schattenrechts.gif) top left no-repeat; }
td.schatten-unten { background:url(typo3conf/ext/user_schattenbox06/schattenunten.gif) top left no-repeat; }
td.schatten-untenrechts { background:url(typo3conf/ext/user_schattenbox06/schattenuntenrechts.gif) top left no-repeat; }
td.schatten-rechts img, td.schatten-unten img, td.schatten-untenrechts img {width:10px; height: 10px;}
)
}
und die ext_emconf.php
<?php
########################################################################
# Extension Manager/Repository config file for ext: 'user_schattenbox06'
#
# Auto generated 21-04-2006 12:33
#
# Manual updates:
# Only the data in the array - anything else is removed by next write
########################################################################
$EM_CONF[$_EXTKEY] = Array (
'title' => 'schattenbox',
'description' => 'textbox schattenbild 06',
'category' => 'plugin',
'author' => 'Sabine Deeken',
'author_email' => 'sabine.deeken@web.de',
'shy' => '',
'dependencies' => 'cms',
'conflicts' => '',
'priority' => '',
'module' => '',
'state' => 'alpha',
'internal' => '',
'uploadfolder' => 0,
'createDirs' => '',
'modify_tables' => '',
'clearCacheOnLoad' => 1,
'lockType' => '',
'author_company' => '',
'private' => '',
'download_password' => '',
'version' => '0.0.0', // Don't modify this! Managed automatically during upload to repository.
'_md5_values_when_last_written' => 'a:11:{s:12:"ext_icon.gif";s:4:"5bcc";s:17:"ext_localconf.php";s:4:"c694";s:14:"ext_tables.php";s:4:"b845";s:24:"ext_typoscript_setup.txt";s:4:"806c";s:16:"locallang_db.php";s:4:"dc78";s:18:"schattenrechts.gif";s:4:"b80f";s:17:"schattenunten.gif";s:4:"81b8";s:23:"schattenuntenrechts.gif";s:4:"2044";s:19:"doc/wizard_form.dat";s:4:"aa98";s:20:"doc/wizard_form.html";s:4:"da8b";s:36:"pi1/class.user_schattenbox06_pi1.php";s:4:"0796";}',
);
?>
wenn ich dran denke, daß ich die anderen Textboxen auf dem site demnächst auch ein wenig verändern muß, wird mir ganz :o #angry#
wäre prima, wenn ihr mir helfen könntet.