0

我有一个内容槽,我需要在其中添加来自 Business Manager 的自定义 css 文件。我想在 head 部分添加自定义文件。有什么办法可以做到吗?

我尝试在 Content Asset 中添加一个自定义 css 文件并将该资产链接到 Content 插槽,但它不起作用。

4

3 回答 3

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)

于 2019-08-06T00:29:59.213 回答
0

我们只需将样式标签烘焙到内容资产或内容槽(内容类型 - HTML)的主体中。在页面头部放置样式标签并没有带来太多好处。在您的div中包含样式标签会使您的标记不那么有效,但即使是旧 IE 浏览器也不会抱怨它。

<style>
    p{color: pink;}
</style>
于 2019-09-19T17:26:53.937 回答
0

在内容资产中使用自定义 CSS 文件并将资产链接到您的插槽应该可以工作我知道您在使用这种方法时遇到的错误是什么吗?

于 2019-12-02T09:26:17.420 回答