<div id="flashBannerMessage">
<object height="90" width="798" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
<param value="$FlashBanner1.URL" name="movie"/>
<param value="high" name="quality"/>
<param value="false" name="menu"/>
<param value="transparent" name="wmode"/>
<embed height="90" width="798" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" menu="false" quality="high" wmode="transparent" src="$FlashBanner1.URL"/>
</object>
</div>
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
- Previous 10 entries
- 1
- Page 22(current)
- 3
- Next 10 entries
that's taken from a site I am using flash banners in. All there is in the CMS is a FileIFrameField called 'FlashBanner1' which is used to store the SWF file.
<?php
class Page extends SiteTree {
public static $db = array(
);
public static $has_one = array(
);
}
class Page_Controller extends ContentController {
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::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
}
/**
* Site search form
*/
function SearchForm() {
$searchText = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : 'Search';
$fields = new FieldSet(
new TextField("Search", "", $searchText)
);
$actions = new FieldSet(
new FormAction('results', 'Search')
);
return new SearchForm($this, "SearchForm", $fields, $actions);
}
/**
* Process and render search results
*/
function results($data, $form){
$data = array(
'Results' => $form->getResults(),
'Query' => $form->getSearchQuery(),
'Title' => 'Search Results'
);
return $this->customise($data)->renderWith(array('Page_results', 'Page'));
}
}
?>
this is my page.php so where and what i need to add here
class Page extends SiteTree {
public static $db = array(
);
public static $has_one = array(
'FlashBanner1' => 'File'
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new FileIFrameField('FlashBanner1'), 'Content');
return $fields;
}
}
.
.
.
then in your template use the flash embed code from above
is there needed to have some module more because i cant find place in banner tab to use file or something
thats what i have after flush
sorry, I had an error in the previous code, if you want the file field to appear above the content field change the line to this:
$fields->addFieldToTab('Root.Content.Main', new FileIFrameField('FlashBanner1'), 'Content');
or if you want it to appear in the banner tab change it to this:
$fields->addFieldToTab('Root.Content.Banner', new FileIFrameField('FlashBanner1'));
Tnx a lot it worked
Can you please continue with your banner image - it seems what you are saying is that I can have an added tab so I can upload and change out the banner image ???
- Previous 10 entries
- 1
- Page 22(current)
- 3
- Next 10 entries