I'm creating a custom Theme Layout for Communities. I've created a Lightning Component and I would like to use the customization options available in Community Builder and reference them from within my template (See image below). Specifically, I would like to access the "Header Image" value, but the other properties would be nice to know as well.
Do I access these in the component like so? (And what are the property names?)
<aura:component implements="forceCommunity:themeLayout" access="global" description="My Theme Layout">
...
<img src="{!v.nameForHeaderImageProperty}">
...
<aura:component>
Or are they accessible as design tokens in the CSS? (And what are the property names?)
.header {
background-image: t(nameForHeaderImageProperty);
}
I've scoured the SFDC dev site as well as the '16 and '17 release notes, but can't seem to find this answer.
Best Answer
I'm posting this answer as a partial answer/work-around to hopefully help others, until a better answer is provided.
Primary Font
Accessing the chosen "Primary Font" from Community Builder can be accomplished by using the design token in the CSS file:
Company Logo and Header Image
(Requires Site.com Studio)
To force your ThemeLayout to use "Company Logo" and "Header Images" uploaded through the UI, it appears that you must use Site.com Studio. You will need to hard-code the path to a generic image name within your Component markup or CSS files:
Component CSS Version
Or
Component Markup Version
Then, when uploading an image file through Site.com Studio, make sure that whomever uploads the file follows your file naming convention and names/renames their file 'myThemesHeaderimage.jpg'. This is less than ideal and looks to have a downsides.
Header Fonts
I have yet to find an answer/workaround for this, but I'll update if I do.