OS: Windows7 (On Debian all works fine)
Browser: Mozila Firefox (In Opera and Chrome all works fine)
Problem: Image in path /assets/teasers/_resampled/SetWidth200-kassa.png is exist.
But WTF is class="jelwfmsmflvhwiiehcaz"? And why Firefox don't show this image?
<img class="jelwfmsmflvhwiiehcaz" alt="kassa" src="/assets/teasers/_resampled/SetWidth200-kassa.png"></img>
From my friends computer he has another error, but images also don't show.
In <img> tag style he has something like style="display: none; width=0; height=0".
TeaserPage.php code:
class TeaserPage extends Page
{
static $can_be_root = false;
static $has_one = array('TeaserImage' => 'Image');
public function getCMSFields(){
$fields = parent::getCMSFields();
$fields->addFieldToTab
( 'Root.Main',
$uploadField = new UploadField
(
$name = 'TeaserImage',
$title = 'Teaser Image'
)
);
$uploadField->setFolderName('teasers');
$uploadField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
$uploadField->setConfig('allowedMaxFileNumber', 1);
$uploadField->setPreviewMaxWidth(80);
$uploadField->setPreviewMaxHeight(80);
return $fields;
}
}
HomePage.php code:
public function LatestTeasers($teasersNumber=3)
{
$holder = TeaserHolder::get()->First();
return ($holder)
? TeaserPage::get()->filter('ParentID', $holder->ID)->sort('ID DESC')->limit($teasersNumber)
: false;
}
HomePage.ss code:
<% if $LatestTeasers %>
<div class="teasers">
<% loop $LatestTeasers %>
<article>
<% if $TeaserImage %>
$TeaserImage.SetWidth(200)
<% else %>
No image
<% end_if %>
<h2>$Title</h2>
<p>$Content</p>
</article>
<% end_loop %>
</div>
<% else %>
No teasers
<% end_if %>