Forum Discussion

id-chalmers's avatar
10 years ago

Which Page template is used for new ideas?

I am hoping to add a custom content block to the page where new ideas are submitted (the <body> class is PostPage). This would be fairly straightforward for an Idea Exchange page: I would create a new custom page in studio with the prefix "IdeaExchangePage" and then select it in my admin under 'custom pages'. But how would I do a similar thing for the Post Page? There's no field for that under Custom Pages in the admin, and post page us not listed under Ideas in the page menu (it's under Messages). Thanks in advance!

  • id-chalmers - As of now, there is no direct way to differentiating, the post page is common for messages, blog post and ideas etc. The only way you have is to get the ID of the board you are on from the URL using the context objects, and make a rest call to check the interaction style of this, if it is idea, you proceed with it.

     

    e.g. you are on this page /t5/forums/postpage/board-id/product-ideas 
    
    You have to make a REST call: /restapi/vc/boards/id/product-ideas/interaction_style
    
    Reponse: 
    <response status="success">
    <value type="string">idea</value>
    </response>

    Let me know if this helps.

  • id-chalmers - As of now, there is no direct way to differentiating, the post page is common for messages, blog post and ideas etc. The only way you have is to get the ID of the board you are on from the URL using the context objects, and make a rest call to check the interaction style of this, if it is idea, you proceed with it.

     

    e.g. you are on this page /t5/forums/postpage/board-id/product-ideas 
    
    You have to make a REST call: /restapi/vc/boards/id/product-ideas/interaction_style
    
    Reponse: 
    <response status="success">
    <value type="string">idea</value>
    </response>

    Let me know if this helps.

    • Urvashi's avatar
      Urvashi
      Mentor
      Hi @Grazitti,

      It actually helped.
      Thanks as i was also facing the same problem.!!

      Urvashi
    • adriana4u's avatar
      adriana4u
      Maven

      Hello,

       

      Sorry to bother you on this, especially when it's been so long.

      This rest API call does what exactly, I don't seem to understand it fully? Will it allow me to create more components to the idea post page? 

       

      Thank you!

      • Akenefick's avatar
        Akenefick
        Genius

        I think the case here is you create a new component that you add to the "Post Page" in studio.

        However you only want the component to show if the post page someone is on is for an idea board. If it is a forum or blog post you don't want the component to appear or function. The API call above is how you check to see if it is an idea board. The full code should look like this:

        <#assign boardType = restadmin("/boards/id/" + coreNode.id + "/interaction_style").value>
        
        <#if (boardType == "idea")>
        
            <#--CODE FOR YOUR COMPONENT GOES HERE-->
        
        </#if>

         

        This way when a user creates a new post your component will only show for the user if they are posting to an idea board.

         

  • Thanks @grazitti!
    To clarify for any others who have the same problem: To modify the 'new idea' page in my community, what I did was to add a new custom component to the page called 'PostPage' under messages in studio. Inside that component, I did the rest call that grazitti describes, then rendered my content only if the response was 'ideas'.