Not sure what the solution is. But Internet Exploder 7 is resizing my images very poorly. I am not sure the workaround and maybe someone can help me.
I want to find a way to use the .setWidth property, but I have to use $Attachment.url which is prohibiting me form doing so. If I just use $Attachment then it throws an error. I am running a lightbox which is why you see all of the <br /> gobly guck in there as the title gets generated in the output of th lightbox.
I s there something I can do in the code that lets me not have to use width="180" and instead set the .setWidth property instead? I am pretty sure this will resolve the quality issue with IE(I hate you)7. :)
here is the Source Code:
in short is is a list of persons passed away with the born date, deceased date and photo.
<div class="clear">
<div class="memoriamContainer">
<% control Memoriams %>
<div class="memoriamPersonContainer">
<div class="ImageMemoriamInfo"><a href="$Attachment.url" rel="lightbox[memoriam]" title="$Name <br /> $DOB - $DeceasedDate <br /> <span > $Description"<span />><img src="$Attachment.url" width="180px" border="0" ></a></div>
<div class="memoriamInfoName"><a href="$Attachment.url" rel="lightbox[memoriam1]" title="$Name <br /> $DOB - $DeceasedDate <br /> <span > $Description"<span />>$Name</a></div>
<div class="memoriamInfo">$DOB - $DeceasedDate</div>
</div>
<% end_control %>
[\code]
and here is the memoriam.php file
<?php
class Memoriam extends DataObject
{
static $db = array (
'Name' => 'Text',
'DOB' => 'Text',
'DeceasedDate' => 'Text',
'Description' => 'Text'
);
static $has_one = array (
'Attachment' => 'File',
'MemoriamPage' => 'MemoriamPage'
);
public function getCMSFields_forPopup()
{
return new FieldSet(
new TextField('Name'),
new TextField('DOB'),
new TextField('DeceasedDate'),
new TextareaField('Description'),
new FileIFrameField('Attachment')
);
}
}
?>
[\code]
and the memoriampage.php file
<?php
class MemoriamPage extends Page
{
static $has_many = array (
'Memoriams' => 'Memoriam'
);
public function getCMSFields()
{
$f = parent::getCMSFields();
$manager = new ImageDataObjectManager(
$this, // Controller
'Memoriams', // Source name
'Memoriam', // Source class
'Attachment', // File name on DataObject
array(
'Name' => 'Name',
'Description' => 'Description',
'DOB' => 'DOB',
'DeceasedDate' => 'DeceasedDate',
), // Headings
'getCMSFields_forPopup' // Detail fields (function name or FieldSet object)
// Filter clause
// Sort clause
// Join clause
);
// If undefined, all types are allowed. Pass with or without a leading "."
$manager->setAllowedFileTypes(array('jpg','png'));
// Label for the upload button in the popup
$manager->setBrowseButtonText("Upload (jpg or png only)");
// In grid view, what field will appear underneath the icon. If left out, it defaults to the file title.
$manager->setGridLabelField('Name');
// Plural form of the objects being managed. Used on the "Add" button.
// If left out, this defaults to [MyObjectName]s
$manager->setPluralTitle('Memoriams');
$manager->setUploadFolder("Uploads/memoriam/images");
$f->addFieldToTab("Root.Content.Memoriam", $manager);
return $f;
}
}
class MemoriamPage_Controller extends Page_Controller{
public function init() {
parent::init();
// Note: you should use SS template require tags inside your templates
// instead of putting Requirements calls here. However these are
// included so that our older themes still work
Requirements::javascript("mysite/javascript/prototype.js");
Requirements::javascript("mysite/javascript/scriptaculous.js?load=effects,builder");
Requirements::javascript("mysite/javascript/lightbox.js");
Requirements::css("themes/blackcandy/css/lightbox.css");
}
}
?>
[\code]