Skip Navigation

[Resolved] Layout keeps on removing chart script from Venngage.

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

Problem:
The user would like to integrate venngage graphics inside Toolset Layouts using the embed code that venngage offers.

Solution:
An editor cell in Toolset Layouts won't save any tags.

There are many ways to add a script tag. As a workaround, you can either:
Add a content template cell and with the content template cell, you will find the JS editor box where you can add the script tag.

  • Add the script using a custom shortcode, and use the shortcode inside the layout. Check this documentation https://developer.wordpress.org/themes/functionality/widgets/
  • Add the script to a widget in Appearance->Widgets, and then use a widget cell on your layout. Check this article https://toolset.com/documentation/user-guides/layouts/widget-area-cell/
This support ticket is created 4 years, 8 months 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: Africa/Casablanca (GMT+01:00)

This topic contains 4 replies, has 2 voices.

Last updated by randallH-3 4 years, 7 months ago.

Assisted by: Jamal.

Author
Posts
#1565341

I'm trying to embed a chart from Venngage to a tab located in Layout. It doesn't save.

Sample code:

<script src="<em><u>hidden link</u></em>" data-vg-id="8AXMpBSp1yA" data-title="Cboe Volatility Index" data-w="640" data-h="430" data-multipage="true" data-f="false"></script>
#1565475

Hello and thank you for contacting the Toolset support.

I’m not sure yet how you are trying to add the script tag you shared within the tab.

If you can tell me what Layout cell you are using and where exactly you are trying to add the script tag, once I know, I will be in a better position to guide you in the right direction.

There are many ways to add a script tag. As a workaround, you can either:
Add a content template cell and with the content template cell, you will find the JS editor box where you can add the script tag.
- Add the script using a custom shortcode, and use the shortcode inside the layout. Check this documentation https://developer.wordpress.org/themes/functionality/widgets/
- Add the script to a widget in Appearance->Widgets, and then use a widget cell on your layout. Check this article https://toolset.com/documentation/user-guides/layouts/widget-area-cell/

I hope this helps. Let me know if you have any doubts.

#1566253

Hi, I added the script to a template inserted inside an editor cell on layout. Now the problem is it not working properly, only 1 chart/script is showing. Is it possible to add more than one on a page?

Editor cell content:


<div id="div-econforecast1">

<div style="background-color:#192e43; color:white; padding:10px 15px;">
    <p style="font-weight:bold; font-size:15px; margin-bottom:0px;">Economic Forecast</p>  
</div>
  <div id="div-econforecast2">

<div class="tab">
  <button class="tablinks active" onclick="openCity(event, 'GDP')">GDP</button>
  <button class="tablinks" onclick="openCity(event, 'Employment')">Employment</button>
  <button class="tablinks" onclick="openCity(event, 'Currency')">$ vs Currencies</button>
   <button class="tablinks" onclick="openCity(event, 'Treasury')">10-Y Treasury Yield</button>
  <button class="tablinks" onclick="openCity(event, 'VIX')">VIX</button>
</div>

<div id="GDP" class="tabcontent" style="display:block">
    [wpv-post-body view_template="vix-chart"]

</div>

<div id="Employment" class="tabcontent">
  <h3>Employment</h3>
  <p>.</p> 
</div>

<div id="Currency" class="tabcontent">
  <h3>$ vs Currencies</h3>
  <p>.</p>
</div>
    
    
<div id="Treasury" class="tabcontent">  
[wpv-post-body view_template="10y-treasury-yield
"]

    </div>
    
    
<div id="VIX" class="tabcontent">
  <p style="font-weight:bold; margin-bottom:0px; font-size:14px;">Cboe Volatility Index</p>
  [wpv-post-body view_template="vix-chart"]
</div>
  
  </div>

</div>

Script inside the template:

<script src="<em><u>hidden link</u></em>" data-vg-id="8AXMpBSp1yA" data-title="Cboe Volatility Index" data-w="640" data-h="430" data-multipage="true" data-f="false"></script>
#1569099

I am not sure how Venngage infographics work, I could not find any online documentation. But I am pretty sure each <script> tag adds only one infographic because it uses an attribute "data-vg-id="ID_OF_THE_GRAPHIC"".
I would say that you will need to add a <script> tag for each infographic you want to add.

If this does not help, please allow me temporary access to your website(WordPress/FTP). Tell me where are you using infographics and what infographics you want to add. Please add any online documentation about Venngage that you are using.
*** Please make a FULL BACKUP of your database and website.***
Your next reply will be private to share credentials safely.

#1578031

Closing this ticket for now. Thanks!