Skip to:
Content
Pages
Categories
Search
Top
Bottom

Suggest a user to post a forum topic with a default topic title.


  • af3
    Participant

    @af3

    In template feedback-no-search.php, I would like to add a suggestion to the user to create a new topic instead (since there is no result of the search). How can I make the searched keywords as the default title of the new topic ?

    I think I can put the shortcode [bbp-topic-form] in the feedback-no-search.php file but would like the new topic form to have a default Title == searched text.

    Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)

  • af3
    Participant

    @af3

    Hate to answer my own post.. anyway, this works okay for me.

    1. add shortcode [bbp-topic-form] in the feedback-no-search.php
    2. use javascript to change the form default value i.e.

    <?php echo do_shortcode('[bbp-topic-form forum_id=4135]'); ?>
    
    <script>
    FormObject = document.forms['new-post'];
    FormObject.elements["bbp_topic_title"].value = '<?php echo bbp_get_search_terms(); ?>';
    </script>

    Robin W
    Moderator

    @robin-w

    Hate to answer my own post.. anyway

    Hey, no brilliant that you did, sorry we didn’t get to you sooner !

    Fantastic that you posted the solution, this will help others searching for it in future !

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar