Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

CTF and backlink tracking


Go to End


952 Views

Avatar
dompie

Community Member, 88 Posts

17 December 2010 at 8:30am

Hello everyone,

I have a class like this:

class Imageattachment extends DataObject{
	static $db = array(
		'Title'		=> 'Varchar(100)'
	);
	static $has_one = array(
		'Image'		=> 'Image',
                'Whatever'       => 'Class'
	);
	function getCMSFields_forPopup(){
		$fields = new FieldSet();
		
		$image = new ImageField('Image', 'Image you want to add');

		$fields->push($image);
		
		return $fields;
	}
}

This works perfectly on any Page I build, except one thing. How do I setup backling tracking for Images?

I noticed that Backlinks only work, when an image is used directly inside a WYSIWYG but not on DataObjects or Pages. I've looked in the Docs and in the source of wysiwygsh classes, but didn't find anything. Any suggestions?