Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit c1fa8ce

Browse files
committed
method to nest items without having them show up in the style guide
1 parent 6d0adc9 commit c1fa8ce

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

core/config/config.ini.default

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,6 @@ ishControlsHide = ""
2626

2727
// the order of pattern states
2828
patternStates = "inprogress,inreview,complete"
29+
30+
// the pattern types that shouldn't be included in the style guide
31+
styleGuideExcludes = "";

core/lib/PatternLab/Builder.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Builder {
5050
protected $mainPageFoot; // the footer to be included on main pages
5151
protected $addPatternHF; // should the pattern header and footer be added
5252
protected $cleanPublic; // whether the public directory should be cleaned out or not on generate
53+
protected $styleGuideExcludes;// which pattern types to exclude from the style guide
5354

5455
/**
5556
* When initializing the Builder class or the sub-classes make sure the base properties are configured
@@ -67,7 +68,8 @@ public function __construct($config = array()) {
6768
foreach ($config as $key => $value) {
6869

6970
// if the variables are array-like make sure the properties are validated/trimmed/lowercased before saving
70-
if (($key == "ie") || ($key == "id") || ($key == "patternStates")) {
71+
$arrayKeys = array("ie","id","patternStates","styleGuideExcludes");
72+
if (in_array($key,$arrayKeys)) {
7173
$values = explode(",",$value);
7274
array_walk($values,'PatternLab\Builder::trim');
7375
$this->$key = $values;
@@ -886,7 +888,7 @@ protected function gatherPatternInfo() {
886888
$patternTypeDash = $patternTypeValues["patternTypeDash"];
887889

888890
// if this has a second level of patterns check them out (means we don't process pages & templates)
889-
if (isset($patternTypeValues["patternTypeItems"])) {
891+
if (isset($patternTypeValues["patternTypeItems"]) && (!in_array($patternType,$this->styleGuideExcludes))) {
890892

891893
$arrayReset = false;
892894

0 commit comments

Comments
 (0)