Skip Navigation

[Resolved] What’t the correct way to add a snippet of code entered via a toolset field?

This thread is resolved. Here is a description of the problem and solution.

Problem:

Use Toolset Types shortcode in custom JS codes.

Solution:

For example:

https://toolset.com/forums/topic/whatt-the-correct-way-to-add-a-snippet-of-code-entered-via-a-toolset-field/#post-2053885

Relevant Documentation:

This support ticket is created 4 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by patriciaC-2 4 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#2053193

Hi!

I'd like to add this embed to a layout that I'm creating using Elementor and Toolset:

<rssapp-wall id="Fub6sx8ctXst1Xl9"></rssapp-wall><script src="hidden link" type="text/javascript" async></script>

I can have it either by entering the full line as a line field or just the id.

I've tried using several ways but none worked so far:

- using the HTML code snippet on Elementor and adding the types field (ex: [types field='customizer-instagram-rss-feed' output=‘raw’][/types] ) -- it displays just the text as is

- using it as a full line doesn't work as well (instead of just entering the id)

I've tried it out first directly on the template and it works, but when I try to make it dynamic, so that I can have one feed per entry, if doesn't recreate the full code.

What's the best way to do this?

Thanks!

Patricia C.

#2053763
WYSIWYG-field.JPG

Hello,

You can try these:
1) Create a custom WYSIWYG field:
https://toolset.com/course-lesson/creating-custom-fields/

2) When you edit/create a post, in above WYSIWYG field, switch to "Text" editor, copy/paste those codes you mentioned above:

<rssapp-wall id="Fub6sx8ctXst1Xl9"></rssapp-wall><script src="<em><u>hidden link</u></em>" type="text/javascript" async></script>

3) And display above WYSIWYG field directly:
https://toolset.com/course-lesson/creating-custom-fields/#displaying-custom-fields

It works fine in my localhost, see my screenshot

#2053865

Hi again!

Yes, it works that way, but I'd like to make the ID coming from a Toolset field, so that embed would have to be something like:

<rssapp-wall id="types field='customizer-instagram-rss-feed' output=‘raw’][/types]"></rssapp-wall><script src="hidden link" type="text/javascript" async></script>

And this doesn't work...

How could I make this dynamic?

Thanks!

#2053885

You can try these:
1) Create a single line field "customizer-instagram-rss-feed"
2) In the post content or content template, add a shortcode block, display below codes:

<rssapp-wall id="[types field='customizer-instagram-rss-feed'][/types]"></rssapp-wall><script src="<em><u>hidden link</u></em>" type="text/javascript" async></script>
#2059423

Hi!

Thanks so much! That worked, thanks so much, otherwise it wouldn't parse the content of the previous field.

Thanks!

#2059425

My issue is resolved now. Thank you!