I’m using NewsPaper 9.1.
When entering a shortcode into a Column Text element manually the shortcode executes and renders perfectly when the page is loaded… 🙂
However, when the same shortcode is added to the same Column Text programatically it does not execute and instead only echoes the shortcode back to the screen.
In the code below, when the variable “trendingstock” is sent to an alert box to test it’s contents, it can be seen to contain a string of the exact shortcode previously entered manually that works fine. However, when added to the column text programatically it only displays an echo of the shortcode.
function ShowChart($attr){
$trendingstock = $attr;
alert(“The function has been passed the shortcode string: ” +$trendingstock );
$(‘.trendingstockchart’).html ($trendingstock);
}
In the code above, ‘.trendingstockchart’ is the class I assigned to the column text in TD Composer. The only output on the page is an echo of the string contents within the column text, no execution of the shortcode it represents.
Thanks,
Gary
Hi,
Please provide some more details about this what you want to achieve, and some screenshots with the code set manually and “programatically”, also provide details about the pace were you set the code for “programatically” shortcode.
Thank you fro your understanding!
Hi Calin,
The overall goal is to select a row in a grid and extract a stock symbol that causes it’s stock chart to be displayed.
In the image below labeled “desired goal”, you can see the way the final page should look. The red arrow shows a column text with a manually entered shortcode that displays a stock chart. This is correct.
In the next image labeled “code”, you can see the code entered into the Custom Code section in NewsPaper 9.1 to make this happen. The code works correctly and builds a string with the desired shortcode in the correct format to call the stock chart. This string is identical to the manually entered string above.
However, in the third image labeled “actual” you can see that even though the row selected is building a correctly formated shortcode…all that happens when it is programatically set in the column text is an echo of the shortcode string rather than an executed shortcode string that displays a stock chart.



Thanks,
Gary
Hi,
Unfortunately I’m not able to see the screenshots -> https://www.screencast.com/t/wFSXTpJ5b
Thank you for your understanding!
Hi,
UNfortunately I still can not see the screenshots, first of theme do not have the entire url, and the second one is on localhost
-> https://www.screencast.com/t/tVZ1nvtO
-> https://www.screencast.com/t/E4fSA1hnbqE0
Thank you!
If you cannot successfully see the third set of images sent to you then please send me instructions on how to get them to you. This website is unpublished and only exists internally on our development machines. That is why I have been sending you copies of screen shots from local drives and localhost. Perhaps a private email address where I can attach files is more appropriate since your software appears to be unable to traverse a path and pickup an image and attach it to a support request.
Thank you for understanding.
Gary
-
This reply was modified 7 years by
gamattox.
Hi,
Just to be clear, if you set the shortcode in column text this is working, and if you try to use a code for automatic shortcode this is show like text, is possible to be something in your code that the column text interpreted like a text not a shortcode from the moment that manually shortcode is working.
Thank you!





