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'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.

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


1007 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?