Forum Discussion

elbranscomb's avatar
elbranscomb
Executive
3 years ago

Hermes skin - Where is this button controlled?

Hi, 

On our Home Page is a big button that says Start a conversation that is displayed after you login. It sit beneath the search banner on the Hero banner.

We would like to change the button to do a different action so more than just changing the text key but also changing the destination when clicked. 

Anyone using Hermes who knows anything about what component this is controlled under. I can't find it referenced in a component (custom or otherwise) or in the page or in the layout for the page. It's like a mystery button that we have no control over. 

  • Yes elbranscomb, you would need to add it to the studio > components section with same name theme-lib.start-conversation-button (Not in CSS section).

    And then made the changes you require. 

  • Hello elbranscomb,
    Added the code for theme-lib.start-conversation-button.

    Make sure to add it to component section, then perform appropriate actions you need.

    <#-- custom start conversation button -->
    <#assign confirm="/search-before-post-mode/true?"/>
    <#-- Check permissions for TKB -->
    <#assign showButton = true />
    <#if coreNode.nodeType == "board">
     <#assign qry = "SELECT conversation_style FROM nodes WHERE id = 'board:${coreNode.id}'" />
     <#assign nodes = liql(qry).data.items![] />
     <#if nodes?size gt 0>
       <#if nodes[0].conversation_style == "tkb" && !(coreNode.permissions.hasPermission("save_unpublished_article"))>
         <#assign showButton = false>
       </#if>
     </#if>
    </#if>
    <#if showButton>
     <#if coreNode.nodeType == "board" && page.name != "TkbPage">
         <#if settings.name.get("config.require_search_before_post") =="require_and_confirm" || settings.name.get("config.require_search_before_post") =="require">
             <#assign link = "/forums/postpage/board-id/${coreNode.id}"+confirm />
         <#else>
             <#assign link = "/forums/postpage/board-id/${coreNode.id}" />
         </#if>
     <#elseif page.name == "TkbPage">
       <#assign link = webuisupport.urls.page.name.TkbChooseTemplatePage.path("board-id",coreNode.id).build() />
     <#elseif coreNode.nodeType == "category">
         <#if settings.name.get("config.require_search_before_post") =="require_and_confirm" || settings.name.get("config.require_search_before_post") =="require">
             <#assign link = "/forums/postpage/category-id/${coreNode.id}"+confirm />
         <#else>
             <#assign link = "/forums/postpage/category-id/${coreNode.id}/choose-node/true" />
         </#if>
     <#else>
         <#assign link = "/forums/postpage/choose-node/true/interaction-style/forum/override-styles/true" />
     </#if>
     <#if user.anonymous>
         <div class="custom-start-conversation-button">
           <#if settings.name.get('board.enable_lazy_authentication') == "authenticateLater">
             <#assign href = link?ensure_starts_with(community.urls.tapestryPrefix) />
             <#assign buttonText = text.format("theme-lib.start-conversation-button.text") />
           <#else>
             <#assign href = webUi.getUserLoginPageUrl(http.request.url) />
             <#assign buttonText = text.format("theme-lib.start-conversation-button.join.text") />
           </#if>
             <a class="lia-button lia-button-primary" href="${href}">${buttonText}</a>
         </div>
     <#else>      
         <div class="custom-start-conversation-button">
           <#if !(coreNode.permissions.hasPermission("create_thread"))>
             <button class="lia-button lia-button-primary lia-link-disabled" aria-disabled="true">${text.format("theme-lib.start-conversation-button.text")}</button>
           <#else>
             <a class="lia-button lia-button-primary" href="${link?ensure_starts_with(community.urls.tapestryPrefix)}">${text.format("theme-lib.start-conversation-button.text")}</a>
           </#if>
         </div>
     </#if>
    </#if>
    <#--/custom start conversation button --> 

     
    Regards,
    Abhishek Gupta

    • elbranscomb's avatar
      elbranscomb
      Executive

      Thanks for supplying this AbhishekGu really helpful. I also wasn't aware we could request the code for theme.lib components so thanks keithkelly - assume this is a support ticket request?

      So to add this to our Studio code do I need to add this as a new component under the Components tab? Or do I need to add it to the component section in our CSS? Thanks

  • To find it, look in the component "custom-hero-welcome"

    ā€ƒ

    Which shows it's actually in "theme-lib.start-conversation-button."

     

    I don't have the conversation button code on hand, but you can request the code for these theme-lib.* components from Khoros. 

  • Yes elbranscomb, you would need to add it to the studio > components section with same name theme-lib.start-conversation-button (Not in CSS section).

    And then made the changes you require.