Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit 10e9540

Browse files
author
Otis Wright
committed
Update ExtraPageFieldsExtension.php
1 parent 1be28bf commit 10e9540

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

code/ExtraPageFieldsExtension.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ class ExtraPageFieldsExtension extends SiteTreeExtension {
88

99
private static $db = array(
1010
'SubTitle' => 'Text',
11-
'MetaTitle' => 'Text'
11+
'MetaTitle' => 'Text',
12+
'MenuTarget' => 'Varchar(255)'
1213
);
1314

1415
public function updateCMSFields(FieldList $fields) {
@@ -39,5 +40,16 @@ public function updateCMSFields(FieldList $fields) {
3940

4041
}
4142

43+
public function updateSettingsFields(FieldList $fields) {
44+
//quick links option
45+
$fields->addFieldToTab("Root.Settings", new DropdownField('MenuTarget', 'Open page in', [
46+
'' => 'Current Tab (Browser default)',
47+
'_blank' => 'New Tab'
48+
]));
49+
}
50+
51+
Public function MenuTarget(){
52+
return empty($this->owner->MenuTarget) ? '' : "target=\"{$this->owner->MenuTarget}\"";
53+
}
4254
}
4355

0 commit comments

Comments
 (0)