0

I have a content slot in which I need to add custom css file from Business Manager. I want to add the custom file in the head section. Is there any way by which I can do it?

I tried adding a custom css file in Content Asset and linked that asset to Content slot but it was not working.

Kriti
  • 2,163
  • 15
  • 16

3 Answers3

1

This functionality exists for Content Assets as a customization to the Page-Show controller in older Site Genesis reference applications and sites. Unfortunately, if you want to do this via a Slot, you'll need to have some JavaScript execute to inject the CSS into the head of the page from either the slot configuration rendering template or from within the slot content itself. Slots are loaded and rendered by the Web Adapter layer which sits between the Internet and the Application Servers. This all happens after the rest of the page is rendered by the App Server.

Also, at this point, I'd consider using Page Designer components instead. Page Designer is expected to be globally available sometime this month. That said, if you need all the features of Slots, PD is not yet at feature parity with Slots. (In terms of scheduling, targeting groups of customers, etc)

sholsinger
  • 3,028
  • 2
  • 23
  • 40
0

We simply bake style tag into the body of the content asset or content slot (content type - HTML). You are not gaining much by having a style tag in the head of the page. Having style tag inside your div makes your markup less valid but none of the browsers even old IE will complain about it.

<style>
    p{color: pink;}
</style>
0

The use of Custom CSS File in content asset and link asset to your slot should have worked may I know what was the error you were facing with this approach?

VinK
  • 69
  • 7