Forum Discussion

Kev_B's avatar
Kev_B
Advisor
8 months ago

Customise a closed Group Hub page

Hi,

I want to customise some Group Hub pages so the same page hosts information/content to non-members, as well as acting as the group hub home for members.

e.g. for a product research program, we have a sign-up survey on a page with a whole load of other info designed to promote the program.

I've managed to do this with coreNode.id, but it only works for an 'Open' type group hub, and my use case requires it to work on 'Closed' or 'Hidden' group hubs. Code below is just from a quick proof of concept test.

 

 

<#if coreNode.id??>
    <#assign node = coreNode.id />
    <p>Node: ${node}</p>
    <#assign query = "SELECT user_context.is_member FROM grouphubs WHERE id = '" + node + "'" />
    <#assign x= rest("2.0","/search?q=" + query?url) />
    <#if x.data?size gt 0>
        <#list x.data.items as item>
            <#if item.user_context.is_member>
                <p>You're a member</p>
            <#else>
                <p>You're not a member</p>
            </#if>
        </#list>    
    </#if>
</#if>

 

 

I've tried a couple of other context objects, but the code in my component doesn't seem to display at all on the page if it's closed or hidden.

Does anybody have experience of customising group hubs in this way?

TIA

  • Hi Kev_B 

     

    I think I know what is going on. I assume you are adding your component to the "Group Hub Page". If someone is not a member, I think a different page actually loads and your code never runs. It is called "Closed Membership Page" and can be edited in studio so you can add whatever you want there for non-members.

  • Hi Kev_B 

     

    I think I know what is going on. I assume you are adding your component to the "Group Hub Page". If someone is not a member, I think a different page actually loads and your code never runs. It is called "Closed Membership Page" and can be edited in studio so you can add whatever you want there for non-members.

    • Kev_B's avatar
      Kev_B
      Advisor

      Thanks Akenefick - I assumed there must've been a different page in play but wasn't sure how to find it. I've got that page in Studio now so can do what I need to do, thank you. Thanks as well for the handy tidbit on finding this out in future as well ğŸ˜€