7913 Posts in 1355 Topics by 930 members
DataObjectManager Module
SilverStripe Forums » DataObjectManager Module » Redirect and Description on FileIFrameField
Discuss the DataObjectManager module, and the related ImageGallery module.
Moderators: martimiz, UncleCheese, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 226 Views |
-
Redirect and Description on FileIFrameField

3 February 2012 at 3:58am Last edited: 3 February 2012 4:19am
Hello
at the moment i try to understand the whole dataobject-thing. my goal is to set some images with a caption and a redirect to different pages. the templaterendering should used on the homepage by a jqery-imageslider (orbit). do i have to use FileIFrameField on a getCMSFields function? or getCMSFields_forPopup. I need to bind the description and the redirect to the CostumImage.
My code for the dataobject so far.
<?php
class CustomImage extends DataObject {
//db fields
static $db = array (
'Description' => 'Varchar(100)'
);/**
* Our custom image class contains one image that is used on one page.
*/
public static $has_one = array (
'SliderImage' => 'Image',
'PageRedirect' => 'SiteTree'
);/**
* Popup for editing a single image.
*
* @return FieldSet The iframe for editing the image.
*/
public function getCMSFields(){
return new FieldSet(
new FileIFrameField('SliderImage')
);
}
}in HomePage i've got
public static $has_many = array(
'CustomImages' => 'CustomImage',
);function getCMSFields() {
$fields = parent::getCMSFields();
//SliderImages
$images = new ImageDataObjectManager(
$this,
'CustomImages',
'CustomImage',
'SliderImage'
);
return $fields;
}
}Is there a good tutorial about the FileIFrameField or HasManyComplexTableField. Thanks for your help.
Pipifix -
Re: Redirect and Description on FileIFrameField

3 February 2012 at 5:28am
The Desription is working. But the sitetree dropdown does'nt work.
My code for the function getCMSFields in CustomImage.phppublic function getCMSFields(){
return new FieldSet(
new TextField('Description'),
new TreeDropdownField('PageRedirectID','Bild verlinkt zu','SiteTree'),
new FileIFrameField('SliderImage','Bild für den Slider', Null, Null, Null, 'Uploads/homepage-sliderimages/')
);
}why is the dropdown not visible? is this a fact of the popup?
Pipifix
-
Re: Redirect and Description on FileIFrameField

11 February 2012 at 2:51am
Sorry for the crosspost. I moved this issue to this thread: http://www.silverstripe.org/dataobjectmanager-module-forum/show/8358?start=8#post311609
Thanks, Pipifix
| 226 Views | ||
|
Page:
1
|
Go to Top |

