Multi-tenant Branding

  
I am looking for ideas on Multi-tenant brand management.  A couple of our modules are required to be branded with our customers colors, & logos. I am using the London Fixed theme. I have the pages/modules seperated as seperate apps, so themes and CSS & images can be referenced from a global non-multi-tenant brand management back-office app.  We are talking about a couple of thousand clients also, so database driven is what is needed.

Running Service Studio 9.0.1.9 on OSP

Thanks in Advance

Allen Witters
Allen -

Couple of choices here:

* Store the settings in tenant-specific entities, then use jQuery or JavaScript in your main Layout to set the CSS to use the tenant-specific settings.

* Store the settings as CSS in the DB, make a Screen that on prep takes the tenant information from Session, pulls the CSS, converts to binary and performs a "Download" at the end of the prep to act as a CSS file, include an import directive in your CSS to this page.

J.Ja
Justin, thanks a million.  I think I need to go the DB route, this is tied to my other post on Domains, that you answered, and it looks like these topics are now merging.  I will need to add an unknown amount of domains and brands at this time, and build a tool to import logos, and CSS changes.  I expect to utilize the London Generator for the CSS/Logo work, take those files and import them as logo and CSS into a global Brand management DB, and also list the incoming IP that is expected to make sure the client does not land on a vanilla page.

Wish me luck :)

Allen
Allen -

Not a problem! Let me know if you get stuck.

J.Ja
Justin, 
I have been able to get the onSessionStart info for URL, I have tested and have working the URL they are coming in with.  Now I want to change the css for all pages in this module.  The 1st page is anonymous.  I have built a global table with the approrpiate brand logo, css text, & url they are supposed to have, and tennant name.  Now I expect to compare the URL to this data, then decide CSS.  How do I apply it to the module?

thanks In advance
Allen
Allen -

Try using the OnSessionStart event to set a session variable based on the hostname so the session is aware of which tenant is being used... then in the preparation of your Layout, get the URL to the image and the CSS to be used. Use the image URL in the appropriate places on the screen for images. Use on-screen JavaScript or jQuery in the Layout to set the CSS. That will be the easiest way to get this done.

J.Ja
Justin, I wish you would of said python, or even basic, I am more of an architect, than coder (No Caffiene for me). Do you have a JS snippet to get me started? The Espace is 100% branded with the incoming URL assets, so I was going to implement the JS at the Espace properties level.  Or if you have a test app I can disect?  I appreciate the help.

thanks In Advance

Allen
Allen -

For the images, just put an Image object onto the screen and point it to the URL from the database.

For the CSS, you can use Expressions with "Escape Content" = "No" to embed CSS on the screen. Something like this Expression:

"<style>
h1 {
  color: " + H1ColorCode + ",
 font-face: " + H1FontFace + "
}
</style>"

Assuming you had variables "H1ColorCode" and "H1FontFace" defined on the screen.

Really, JavaScript is not needed the more I think about it.

J.Ja


Justin, I have the images working fine, thanks for the help!  Now on to CSS.  I would like to use the CSS I have stored in the Branding entity, Text File, with the output from the London Generator.  It is not really big maybe 50 lines. I would like to push that as the Theme's CSS for the Multi-tenant Espace....  I can see how your example work for the h1 style or any individual style, how do I drop the whole CSS out of a text attribute into an Espace?

BTW, this system is getting easier, really starting to enjoy it.

Allen
Allen -

Just have an expression like above, but something like:

"<style>" + StyleText + "</style>"

:D

J.Ja
Justin, excellent instructions...
Got it to work on a page, wonderfully!  Is there any way to set this at the Espace level? So I do not have to have it on every page?  So it forces the Theme or the eSpace to use the CSS?

Thanks in Advance

Allen
Justin, I put the expression in the common footer, and all pages love me!

Thanks, Allen
Allen -

Glad to hear it!

J.Ja