Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter manasluminary

    (@manasluminary)

    Thank you so much for fixing the documentation. It worked. Now I am trying to print the shortcode in my function.php

    The set up I have now is that I call an ajax function and it returns the HTML as below and I set this to the HTML.

    However when I look at the inspect mode, I see

    <div id=”visualizer-9242-887479811″ class=”visualizer-front visualizer-front-9242″></div>

    <!– Not showing structured data for chart 9242 because title is empty –>

    Is there any limitation around shortcode which can make this happen ?

    https://luminaryproperties.co.uk/check-average-rent-in-a-postcode/

    var data = {	
    			          'action': 'hmorent_data',
    			          'postcode': postcode,
    			        };
    			        jQuery.post(ajaxurl, data, function(response) {
    			            if(response != ''){
    			                jQuery('.ajaxpostresponce_hmo').html(response);
    			            }else{
    			                jQuery('.ajaxpostresponce_hmo').html("No Results Found");
    			            }
    			        }).fail(function(xhr, status, error) {
    			            console.log(status);
    			            console.log(error);
    			        });
    function hmorent_data()
    {
    
        $postcode = $_POST['postcode'];
    	$_SESSION["hmorentdata_postcode"] = $postcode ;   
    	echo "<div class='mortgage'><label>Monthly Mortgage Payment(£):</label>" . round($mortgage, 2) . "</div>";
    	//echo do_shortcode( '[contact-form-7 id="91" title="quote"]' );
    	echo do_shortcode( '[visualizer id= 9242 title="HMO Rent"]' );  
        exit();
    }
    Thread Starter manasluminary

    (@manasluminary)

    Thank you Tobias. In my case, I would like to dynamically read the data from an external source based on user’s search criteria, and I am trying to display it on the screen. I only want to show the data to the user and I do not want the data to be saved into the database. So I guess, there is no hook available to dynamically modify the data which is shown to the user on runtime.

    Kind Regards
    Manas

    Thread Starter manasluminary

    (@manasluminary)

    Hi Tobias,

    I was not too clear on my question so I can see how you have clarified about the rest API integration. Actually I was wondering about if I can populate the table content dynamically. As I have understood, I can create a table from WordPress admin Tablepress screen. While specifying the table, I have to also specify the content of the table. As you can see in below URL, the table loads correctly. Just to explain my problem,
    https://luminaryproperties.co.uk/check-average-rent-in-a-postcode/

    I have added jQuery code on click of button to set the DOM using below code. It kind of works, but the sorting does not work for the column 2 as I am playing with the dom directly. So I wonder if there is anyway to set the table content for that session instead of paying with dom.

    Business case is, different users are logged into the site and searching, But based on the search they will see different values in the table

    jQuery(“.tablepress-table-name.tablepress-table-name-id-HMORent”).text(“Hello world!”);
    jQuery(“.row-2 .column-2”).text(“Hello world!”);

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