• Hi threre,

    the quiz below displays different result-pages based upon a particular score that a user has achieved.

    Now I’d like to include a shortcode which embeds a form on each result page for users to enter data / follow the desired call to action.

    In order to realized that I added the shortcode via WP Editor to the result page like that:

    <!-- wp:shortcode --> 
    
    [calcium-quiz-hook] 
    
    <!-- /wp:shortcode -->

    The desired content, however, is not being pulled-in.

    I understand the quiz uses Ajax to request the data, and just rendering the shortcode in Ajax alone is a challenge.

    How would you go about solving this issue?

    Thanks,

    Jan

    • This topic was modified 1 year, 5 months ago by Jan.
    • This topic was modified 1 year, 5 months ago by Jan.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Jan

    (@locke85)

    Hi there,

    just checking in to see whether anyone has got an idea on how to bring this forward?

    Thanks,

    Jan

    Plugin Author Bob

    (@prasunsen)

    Hello,

    We already process all shortcodes in the final screen. I took your quiz and don’t see any unprocessed shortcode in the console output. If the calculator doesn’t work in an ajax response, you need to ask the calculator developer.

    • This reply was modified 1 year, 5 months ago by Bob.
    Thread Starter Jan

    (@locke85)

    Hi Bob,

    thanks for getting back. First I’d like to get the shortcode issue sorted on the general result page. Once this is solved I’ll look into the results calculator and its point-based results pages.

    Meanwhile I ran some more tests and can confirm that a CF7 shortcode – for example – is working on the results page. Then I compare the CF7 shortcode to the custom shortcode that is not working:

    // GP - Custom shortcode
    
    function ad_shortcode($atts, $content = null) {
      ob_start();
      do_action('as-eignung-good');
      return ob_get_clean();
    }
    add_shortcode('as-eignung-good', 'ad_shortcode');

    The custom shortcode gets embedded differently:

    1. Embed the shortcode at a particular position on a page
    2. Define on which page the content of the shortcode is being loaded (display rule)

    #2 is probably causing the issue because at page load only the quiz is being loaded and when the user gets to the results page only #1 is working but #2 does not get the required trigger because the quiz-results page does come with a reload of the page.

    I have seen other quiz plugins that define quizzes as custom post type which in turn would allow me to change the display rule accordingly (not targeting a page but rather the relevant quiz).

    Any thought on this are much appreciated.

    Thanks,

    Jan

    I have an option for you. To get the best result you should contact with laptop repair dubai team. Also they have the good team to solve every type of laptop issue.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Result page / embed shortcode’ is closed to new replies.