Skip to content
This repository
Browse code

Toggle metadata fields in SiteTree->getCMSFields()

To save space, reduce clutter and deemphasize the fields.
Partially fixes #7405, needs better design though.
  • Loading branch information...
commit 69e4fa072a11e5eafcd4e03cfa9776bffd0ad3e1 1 parent 3ff0c42
Ingo Schommer authored July 15, 2012

Showing 1 changed file with 10 additions and 6 deletions. Show diff stats Hide diff stats

  1. 16  code/model/SiteTree.php
16  code/model/SiteTree.php
@@ -366,7 +366,7 @@ public static function page_type_classes() {
366 366
 	}
367 367
 	
368 368
 	/**
369  
-	 * Replace a "[sitetree_link,id=n]" shortcode with a link to the page with the corresponding ID.
  369
+	 * Replace a "[sitetree_link id=n]" shortcode with a link to the page with the corresponding ID.
370 370
 	 *
371 371
 	 * @return string
372 372
 	 */
@@ -1854,10 +1854,14 @@ function getCMSFields() {
1854 1854
 					$urlsegment,
1855 1855
 					new TextField("MenuTitle", $this->fieldLabel('MenuTitle')),
1856 1856
 					$htmlField = new HtmlEditorField("Content", _t('SiteTree.HTMLEDITORTITLE', "Content", 'HTML editor title')),
1857  
-					new TextField("MetaTitle", $this->fieldLabel('MetaTitle')),
1858  
-					new TextareaField("MetaKeywords", $this->fieldLabel('MetaKeywords'), 1),
1859  
-					new TextareaField("MetaDescription", $this->fieldLabel('MetaDescription')),
1860  
-					new TextareaField("ExtraMeta",$this->fieldLabel('ExtraMeta'))
  1857
+					ToggleCompositeField::create('Metadata', _t('SiteTree.MetadataToggle', 'Metadata'),
  1858
+						array(
  1859
+							new TextField("MetaTitle", $this->fieldLabel('MetaTitle')),
  1860
+							new TextareaField("MetaKeywords", $this->fieldLabel('MetaKeywords'), 1),
  1861
+							new TextareaField("MetaDescription", $this->fieldLabel('MetaDescription')),
  1862
+							new TextareaField("ExtraMeta",$this->fieldLabel('ExtraMeta'))
  1863
+						)
  1864
+					)->setHeadingLevel(4)
1861 1865
 				),
1862 1866
 				$tabDependent = new Tab('Dependent',
1863 1867
 					$dependentNote,
@@ -2730,4 +2734,4 @@ static function on_db_reset() {
2730 2734
 		self::$cache_permissions = array();
2731 2735
 	}
2732 2736
 
2733  
-}
  2737
+}

0 notes on commit 69e4fa0

Please sign in to comment.
Something went wrong with that request. Please try again.