Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hiding patterns with an underscore, but still being able to access the pattern with includes #210

Closed
theorise opened this issue Dec 16, 2015 · 15 comments

Comments

@theorise
Copy link

According to the docs, if you append an underscore (_) to the pattern name it should "no longer show up in the drop-down navigation, the media pattern sub-type "view all" page, nor the style guide".


I want to hide a pattern from the drop-down and the 'view all', however I still want to use the pattern as an include, and for the patterns using it to be displayed (as they have no underscore in their file name/parent folder name).

If I try this, the builder will just tell me that the pattern is missing 'Could not find pattern with key atoms-$'.

@bmuenzenmeyer
Copy link
Member

I've seen use cases for this too. It should definitely be considered.
@dmolsen does PL PHP handle this as theorise suggests?

@dmolsen
Copy link
Member

dmolsen commented Dec 16, 2015

@bmuenzenmeyer -

Yes. It's borked in PL2 but @theorise is correct in his interpretation. PL2 also supports a dash at the beginning of a file name to denote "show in the pattern drop down but don't show in the 'view all' views."

@bmuenzenmeyer
Copy link
Member

Nice - thanks for additional information.

@geoffp
Copy link
Contributor

geoffp commented Dec 16, 2015

Oh wow -- I didn't even know I wanted this feature, but I do. Our "view
all" is horrifyingly broken by multiple patterns that use fixed positioning.

On Wed, Dec 16, 2015 at 10:53 AM Brian Muenzenmeyer <
notifications@github.com> wrote:

Nice - thanks for additional information.


Reply to this email directly or view it on GitHub
#210 (comment)
.

@bmuenzenmeyer
Copy link
Member

Yeah the more I think about this the more it makes a ton of sense. I do this on an internal instance of Pattern Lab with some base patterns that get parameterized downstream. The bases are pretty useless when used like this..

I'll get this in asap, per strong feedback!

@bmuenzenmeyer bmuenzenmeyer self-assigned this Dec 16, 2015
@bradfrost
Copy link
Member

Hey @geoffp,

Our "view all" is horrifyingly broken by multiple patterns that use fixed positioning.

The way I deal with that stuff is to override the styles in styleguide-specific.scss. From the comments at the top of the file:

This stylesheet is for styles you want to include only when the interface is being viewed within Pattern Lab.
This is helpful for displaying demo styles for grids, animations, color swatches, etc
It's also helpful for overriding context-specific styles like fixed or absolutely positioned elements
These styles will not be your production CSS.

@bmuenzenmeyer
Copy link
Member

Internal Note

Odd that this code does not appear to be functioning? There are no unit tests on the front-end menu generation, it's years old and 💩

Update
was missing an additional check. Too tired to find it tonight

@bmuenzenmeyer
Copy link
Member

@dmolsen I assume it should however be accessible via lineage links?

@bmuenzenmeyer
Copy link
Member

This is live in dev branch and will close automatically when it reaches master.

@bmuenzenmeyer bmuenzenmeyer removed their assignment Dec 18, 2015
@bmuenzenmeyer bmuenzenmeyer modified the milestone: v1.1.0 Dec 30, 2015
@geoffp
Copy link
Contributor

geoffp commented Dec 31, 2015

@bradfrost just now took your advice on styleguide-specific.css. Works like a charm!

@bradfrost
Copy link
Member

Great to hear! Happy new year!


Brad Frost
http://bradfrost.com
http://twitter.com/brad_frost

On Thu, Dec 31, 2015 at 9:54 AM, Geoff Pursell notifications@github.com
wrote:

@bradfrost https://github.com/bradfrost just now took your advice on
styleguide-specific.css. Works like a charm!


Reply to this email directly or view it on GitHub
#210 (comment)
.

@EvanLovely
Copy link
Member

Would love this feature too! Very useful for when the base partial being imported doesn't need to be shown alone.

@simonknittel
Copy link

@bmuenzenmeyer This does not seem to be working. I just updated my PatternLab-Node to the dev-branch version.

My name is called _icon.mustache and located in the directory 00-atoms. I'm trying to include it with {{> atoms-icon}}.

The atom does not show up in the navigation or 'all' view, but also not in the template where I want to include the atom.

I don't get any errors.

@bmuenzenmeyer
Copy link
Member

I got this working in a copy of dev with {{> atoms-_icon}} Let me know if that works for you.

Not ideal but may work for now if you are in a pinch. I assume the preference by everybody would be to not include the underscore, but it might also signify that you are including an excluded pattern?

Feedback appreciated

@simonknittel
Copy link

That works. Thanks! I tried everything, but not this ...

Would prefer it without the underscore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants