styleguidekit-assets-default icon indicating copy to clipboard operation
styleguidekit-assets-default copied to clipboard

Displaying theme object inside of PL files

Open bradfrost opened this issue 7 years ago • 9 comments

@bmuenzenmeyer @EvanLovely:

This is likely a Very Dumb Question from Brad, but here it goes: I see that the theme object is available in the browser (if I open the console and type theme it returns the object); how do I get the info within theme to display in, say, html/partials/header.html?

I know we are using Hogan to render our templates, but I'm scratching my head why adding {{ theme.logoImage }} isn't printing out the path to the logo.

Forgive the dumbness of the question, but once I have an idea of how to work with the theme object in this repo, I can get everything wired up!

bradfrost avatar Jan 08 '18 23:01 bradfrost

@bradfrost It's not a dumb question at all.

Take a look at the commit above on the theme-in-header branch - the partial was not being processed as a Hogan template, like some of its siblings were. It was only being included using the code here: https://github.com/pattern-lab/styleguidekit-assets-default/blob/develop/gulpfile.js#L59

Anyway, I committed it with obviously poor UX of actually displaying the theme content.

Make changes as you see fit, run gulp --copy-dist=../../../public and you are on your way.

Feel free to continue working off of this branch if you like.

Aside

I also see that you are starting work inside feature-themes, but you should really be branching off of develop per the guidelines, otherwise we will be diverging from all that work like last time.

image

bmuenzenmeyer avatar Jan 09 '18 13:01 bmuenzenmeyer

@bmuenzenmeyer Thanks a ton for this! This all makes sense to me.

I also see that you are starting work inside feature-themes, but you should really be branching off of develop per the guidelines, otherwise we will be diverging from all that work like last time.

Forgive me, I still feel like I'm all thumbs with this process. Can I just work in theme-in-header for now for this stuff?

bradfrost avatar Jan 09 '18 16:01 bradfrost

You betcha.

bmuenzenmeyer avatar Jan 09 '18 17:01 bmuenzenmeyer

Cool, thanks @bmuenzenmeyer. I've committed changes here: https://github.com/pattern-lab/styleguidekit-assets-default/commit/1b9b4a031ae16d73b036d3df5e90d6d1373dccb7

Any way you could give a quick glance and a thumbs up just to see if I'm not screwing things up? With so many branches and stuff swirling around, I'm still struggling to get my head around where I should be doing work. Sorry for being dumb!

bradfrost avatar Jan 09 '18 18:01 bradfrost

@bradfrost 👍

bmuenzenmeyer avatar Jan 09 '18 18:01 bmuenzenmeyer

Awesome thanks!

bradfrost avatar Jan 09 '18 18:01 bradfrost

Alright, I may have closed this too soon. Next thing I need to do is to get stuff inside the iframe listening to the config. Is that possible/easy?

bradfrost avatar Jan 10 '18 17:01 bradfrost

as in, individual patterns?

bmuenzenmeyer avatar Jan 10 '18 21:01 bmuenzenmeyer

As in, inside the viewall template and individual patterns. Basically anything that's inside the iframe.

bradfrost avatar Jan 10 '18 21:01 bradfrost