cq5
  • aem
  • sightly
  • 2017-02-14 57 views 2 likes 
    2

    我们有一个示例站点,其中包含基本模板和页面级别组件。 在其head.html中,我们包含了未在页面上反映的上下文中心。如下所示,我们的示例站点head.html的代码片段:目标:能够在AEM 6.2站点上使用contexthub

    <head> 
    <sly data-sly-resource="${ @ path = 'contexthub' , resourceType='libs/granite/contexthub/components/contexthub'}"></sly> 
    <title>${head.title}</title> 
    </head> 
    

    按我的理解,为了使我们需要ContextHub功能,包括在我们的页面级别的头部contexthub组件零件。我仍然无法看到我的网页上的contexthub组件。如果我错过了实施相同步骤的任何步骤,请纠正。

    +0

    没有你跟着[土坯contexthub](https://docs.adobe.com/docs/en/aem/6-2/develop/personalization/contexthub/ch-添加.html)文档。你能提供你做过什么吗? – VAr

    +0

    是的,我做了,但没有出现在页面上。请参考http://stackoverflow.com/questions/42228225/to-use-contexthub-on-an-aem-site查看我已经使用的代码片段 – parul17singh

    回答

    0

    试试这个:

    <head> 
    
    <meta data-sly-resource="${'./config' @resourceType='cq/personalization/components/clientcontext_optimized/config'}" data-sly-unwrap></meta> 
    <meta data-sly-resource="${'./contexthub' @resourceType='granite/contexthub/components/contexthub'}" data-sly-unwrap></meta> 
    
    <title>${head.title}</title> 
    </head> 
    
    相关问题