Forum Discussion

dustin's avatar
dustin
Expert
9 years ago

How do I differentiate a text string by category/board?

In our knowledgebase area, we would like the "New Message" button to display "New Article".  The text key for this is...

menubar.button.new_message 

 

However, when this is changed, it also affects the forums area where we would like it to say "New Message".  

 

Is there a way to have this button change text based on the board?   If not, is there freemarker code I could use to create a custom button that behaves the same way?

 

  • dustin's avatar
    dustin
    9 years ago

    As Vishwajeet mentioned, the following does work...

     

     

    menubar.button.new_message  = New ${general.Message}

     

     

    However, if you do a search for the the text key general.Message, you'll see how the magic happens.  Using the @place extension you can specify strings based on location.

     

     

    menubar.button.new_message                        = New Post                         
    menubar.button.new_message@place:tkb       = Create New Document   

     

     

    Other location values include...

     

    @place:tkb     
    @place:board
    @place:blog   
    @place:idea     
    @place:qanda  //question
    @place:support
    @place:contest

     

    Note you can also use the @message extension for specific types of messages and string them with the @place extension

    Examples...

     

    general.Message@place:blog@message:root     = ${general.Message}
    general.Message@place:blog@message:reply    = ${general.Comment}

     

     

  • Hi dustin,

     

    As this is OOB components using same text-key. You can add a page specific script to change the title of the button as a work around.

     

    Regards,

    Mahesh Revanwar

    If my post is helpful and answers your question, please give "Kudos" and "Accept it as a Solution."

     
    • vishwajeet_hol's avatar
      vishwajeet_hol
      Expert

      Hi dustin,

       

      Have u tried this...

      menubar.button.new_message  = New ${general.Message}

       

      Thanks,

      Vishwajeet

       

      Please give a Kudo or Accept as solution if my post helps you.:smileyhappy:

      • dustin's avatar
        dustin
        Expert

        As Vishwajeet mentioned, the following does work...

         

         

        menubar.button.new_message  = New ${general.Message}

         

         

        However, if you do a search for the the text key general.Message, you'll see how the magic happens.  Using the @place extension you can specify strings based on location.

         

         

        menubar.button.new_message                        = New Post                         
        menubar.button.new_message@place:tkb       = Create New Document   

         

         

        Other location values include...

         

        @place:tkb     
        @place:board
        @place:blog   
        @place:idea     
        @place:qanda  //question
        @place:support
        @place:contest

         

        Note you can also use the @message extension for specific types of messages and string them with the @place extension

        Examples...

         

        general.Message@place:blog@message:root     = ${general.Message}
        general.Message@place:blog@message:reply    = ${general.Comment}