Display text at top of form based on ID

Answered

6 Comments

  • Trapta
    Community Moderator

    Hi @Rob H.,

    If you are using Copenhagen Theme, then go to line no. 8 in your new_request_page.hbs and replace the code line no.8 to line no. 15 with -

    <h1 class="form-title">
    {{t 'submit_a_request'}}
    {{#if follow_up}}
    <span class="follow-up-hint">
    {{follow_up}}
    </span>
    {{/if}}
    </h1>

    Paste the below script at the bottom of your new_request_page.hbs template -

    <script>
    var id = window.location.href.match(/[0-9]+/)[0];
    if ( id == 'FORM_ID' ) { // Make sure to replace FORM_ID with your request form ID.
    $('.form-title').text('TITLE_FOR_FORM'); // Replace it with the title you want
    }
    </script>

    Let me know how it goes for you.

    Thanks

    Trapta

    Team Diziana

    1
  • Rob H.

    Hi @Trapta, 

    This is great. Thank you. 

    It seems to be working fine except for when I try to use Dynamic Content for the title. Is that something that's possible with different formatting? 

    0
  • Trapta
    Community Moderator

    Yes @Rob, that is possible. Simply put the DC in text(DC).

    Thanks
    Trapta

    0
  • Rob H.

    Hmm, I get an error when inserting the DC placeholder in the parenthesis. 

    <script>
    var id = window.location.href.match(/[0-9]+/)[0];
    if ( id == '360001300473' ) {
    $('.form-title').text('{{dc.placeholder}}');
    }
    </script>

    0
  • Trapta
    Community Moderator

    @Rob, that's because when you use DC in the help center, the syntax should be {{dc 'placeholder'}} instead of {{dc.placeholder}}.

    Give it a shot and let me know how it goes for you.

    Thanks

    Trapta

    Team Diziana

    2
  • Rob H.

    @Trapta, ah..that's right. Thank you. It's all displaying properly for us now. 

    0

Please sign in to leave a comment.

Powered by Zendesk