Unable to embed a shortcode in a cell
-
I’m able to use a shortcode such as [user_login] (shortcode available via a plugin) in a table, but not [sc name =”AWeberEmail”] (shortcode I created with a plugin).
When attempting the later, the page renders momentarily (with icon indicating table rending visible) before the page goes white, with only the first sc value displayed.
The page I need help with: [log in to see the link]
-
Hello @michaeltcarlson
Thank you for contacting us.
Could you please clarify how exactly do you create the shortcode and how insert it to the table?
Perhaps you can make screenshots, and provide more detailed description. Then I will be happy to answer it.Best regards.
Hiya @supsysticom,
Thanks for the response. I’m happy to provide more detail.
When defining a custom shortcode I use a fairly popular plugin, WordPress Shortcoder. (https://www.ads-software.com/plugins/shortcoder/).
With WP Shortcoder installed a user is able to create custom shortcodes by interacting with a UI in WP–> Settings. To create a shortcode, you:
Give a name for the shortcode
Paste the HTML/Javascript as content
Save
Insert the shortcode [sc name=”my_shortcode”] in your post/page.
Voila ! You got the HTML/Javascript in your post/page.Here’s a screenshot of of the WP Shortcoder UI. The example is one of the shortcodes I want to place in a Supsystic table cell:
https://www.dropbox.com/s/zx6uakdps2z89md/Shortcoder%20UI.PNG?dl=0
Here’s the given table in Supsystic’s Editor mode:
https://www.dropbox.com/s/6fpom5d8qzpfa4p/Table.PNG?dl=0
I placed the table on a page…
https://www.dropbox.com/s/x3my67debd4s17n/Table%20Page.PNG?dl=0
…but after doing so the page fails to load.
https://www.dropbox.com/s/w5sl2uwfva48yav/No%20Page%20Load.PNG?dl=0
Before contacting you, I needed to confirm that the action of placing the custom shortcode within a Supsystic table was the root cause of the page load. So I cloned the page and placed the custom shortcodes directly on the page (not in a table). They function properly:
Page without table (Edit Mode):
https://www.dropbox.com/s/vttpbhr41ue8zrf/Thank%20You%20Page%20No%20Table%20-%20Edit.PNG?dl=0Page without table (View Mode):
https://www.dropbox.com/s/x4j2s739yv3lt4k/Thank%20You%20Page%20No%20Table%20-%20View.PNG?dl=0Accordingly and for your reference, here are links where you can compare the page with the table to a page without it:
Live Sample (Page With Table):
https://prisonfamilyaid.com/thank-you-table/?email=mcarlson%40smbcircle.com&from=test%40test.com&meta_message=1001&name=Test%20JavaScripts&unit=awlist4837206Live Sample (Page Without Table):
https://prisonfamilyaid.com/thank-you/?email=mcarlson%40smbcircle.com&from=test%40test.com&meta_message=1001&name=Test%20JavaScripts&unit=awlist4837206Finally I have other shortcodes in other Supsystic tables that work splendidly. The have the typical shortcode spelling, i.e. [shortcode]. There’s something about the format of the custom shortcodes- [sc name=”shortcode”] that is causing the page render failure. Could it perhaps be the quotes?
Cheers,
MCSide note: Posts in the pending queue are never held for 72 hours, that’s just a boilerplate. It’s usually only a few minuted based on the time of day. A couple of hours on the outside.
Good to know. Thanks!
Thank you for your explanation.
I opened the page with table and for 2 second it was opened. After that – page became empty.
There is some script that erases everything on the page.
Please try to deactivate all your plugins one by one and check the issue. Thus you will find out which plugin causes the error.Afterwards let us know about the result.
Best regards
Hi @supsysticom,
As per your request, I deactivated/reactivated all plugins. No conflicts. Phew!Took a look at the page itself and found the source of the page load error… The page has a script in the header that captures inbound URL parms, which in turn are populated via the custom shortcode inserted in the Syosystic table. Here’s the script:
<script type=”text/javascript”>
var formData = function() { var query_string = (location.search) ? ((location.search.indexOf(‘#’) != -1) ? location.search.substring(1, location.search.indexOf(‘#’)) : location.search.substring(1)) : ”;
var elements = [];
if(query_string) {
var pairs = query_string.split(“&”);
for(i in pairs) {
if (typeof pairs[i] == ‘string’) {
var tmp = pairs[i].split(“=”);
var queryKey = unescape(tmp[0]);
queryKey = (queryKey.charAt(0) == ‘c’) ? queryKey.replace(/\s/g, “_”) : queryKey;
elements[queryKey] = unescape(tmp[1]);
}
}
}
return {
display: function(key) {
if(elements[key]) {
document.write(elements[key]);
}
else {
document.write(“<!–Not Applicable–>”);
}
}
}
}
(); </script>Not sure why this would throw an error. Thoughts?
Here’s a test link:
https://prisonfamilyaid.com/thank-you-table/?email=mcarlson%40smbcircle.com&from=mcarlson%40smbcircle.com&meta_message=1001&name=Test%20AWeber&unit=awlist4837206Thank you for your feedback.
Could you clarify – the page with table you sent on your second message and on the last – the same,
but when I checked it before – the result was different (now I can view the page). Perhaps, you changed some settings of the shorcode or deactivate some of your plugin?
(as you can see on the browser console now – there are some other errors,about shortcode content – https://prntscr.com/h4e7pk)While waiting I fiddled with the header script and got the page to render. The table will render without the custom short codes, but when include it will not. I’ve tested this with and without plugins active, and with and without page scripts in place.
The issue is not an conflict with another application or script. Quite simply, when I place a custom shortcode, e.g., [sc name=”my_shortcode”] in a table cell, the table will not load. If, instead of the custom shortcode I place text, the table renders perfectly.
For your viewing pleasure:
Page without custom shortcodes in table (works fine):
https://prisonfamilyaid.com/thank-you-with-table-no-shortcodes/?email=mcarlson%40smbcircle.com&from=mcarlson%40smbcircle.com&meta_message=1001&name=Test%20AWeber&unit=awlist4837206Page WITH custom shortcodes in table (won’t render):
https://prisonfamilyaid.com/thank-you-table/?email=mcarlson%40smbcircle.com&from=mcarlson%40smbcircle.com&meta_message=1001&name=Test%20AWeber&unit=awlist4837206Again, my question is:
Is there something about the format of the custom shortcodes- [sc name=”shortcode”] that is causing the page render failure. Could it perhaps be the quotes?MC
Hello @michaeltcarlson
Once more thank you for explanation and test pages.
From the error on the browser console I found that you use cache (https://prntscr.com/h4pjuq), try to deactivate all cache plugins and check the result.
Also, could you please, try to create another shortcode on the Shortcoder plugin (some simpler)? So we will check if the same result will be.
Best regards
Hello @supsystic,
I deactivated all cache plugins, the result is the same, the table will not render.
I replaced the custom shortcodes with standard (user) shortcodes. The table rendered just fine.
Will you PLEASE answer my question?????
Again, my question is:
Is there something about the format of the custom shortcodes- [sc name=”shortcode”] that is causing the table to fail to render? Could it perhaps be the presence of quotes within the bracket?MC
-
This reply was modified 7 years, 4 months ago by
michaeltcarlson.
Hi there again,
I’ve determined that the error you see (and have so kindly provided) is caused between a conflict with the table and the aforementioned header script, which is required in order to populate shortcode values.The script is provided by my marketing automation service, and cannot be modified.
Therefore I’m going to redesign the page to present the salient information outside of a table.
I appreciate the time you’ve taken to assist me; and again I love the plugin.
Cheers,
MCHello @michaeltcarlson
I’m sorry for didn’t answer on the question about quotes, because I try to check this information.
OK, thank you for contacting us and for your feedback. We’re happy that you like our plugin and really appreciate it.
If you have any other questions – just let us know.Best regards
-
This reply was modified 7 years, 4 months ago by
- The topic ‘Unable to embed a shortcode in a cell’ is closed to new replies.