If you want to run a Slider on your Website and control the content like images and text via an API you can do that in this way:
- The PRO-Version of the WordPress-Plugin SmartSlider 3 can use RSS-Feeds as Contentsource.
So you need an RSS-feed to feed the Slider-Plugin.
If the API gives you RSS everything is ok. But those APIs are rare. -
Create an RSS-feed out of JSON via the PRO-version of the JCI-plugin:
Create a Template in the JCI-TemplateManager with the following code. This is just static rss.<?xml version="1.0" encoding="windows-1252"?> <rss version="2.0"> <channel> <title>titleexample</title> <description>descriptionexample</description> <link>http://...link</link> <copyright>Copyright 20...</copyright> <docs>http://....docs</docs> <language>en-us</language> <lastBuildDate>Tue, 21 Oct 2019 03:19:24 -0800</lastBuildDate> <managingEditor>info@.....com</managingEditor> <pubDate>Tue, 21 Oct 2019 12:18:22 -0300</pubDate> <webMaster>webmaster@....com</webMaster> <generator>JCI</generator> <image> <url>http://www.....gif</url> <title>titleimage</title> <link>http://www....imagelink.htm</link> <description>descriptionimage</description> <width>480</width> <height>480</height> </image> <item> <title>titleitem</title> <description>descriptionitem</description> <link>http://www.linkitem</link> <comments>commentsitems</comments> <pubDate>Tue, 21 Oct 2019 07:38:46 -0800</pubDate> </item> </channel> </rss>
-
To achieve this, build a JCI-Shortcode like [jsoncontentimporterpro url=http://….id=NUMBER_OF_ABOVE_TEMPLATE debugmode=10]
You might have to add authentication-info or similar data.
Publish the page and view it in ther browser. The browser should show you the debug-infos of the plugin and in the best case the RSS-code.
Then remove “debugmode=10” from the shortcode and publish the page again.
Add “?show=oc” to the browser. This should remove the template header, footer etc. and gives you the pure RSS-feed. -
If the previous step gave you RSS you now can edit the template and insert the JSON-data. In the end you get a RSS-feed out of JSON.
Notice: RSS is sensitive to speacial chars and chars used for RSS itself. Therefore consider to mask JSON-data in a CDATA-tag.<![CDATA[ text.... ]]>
- The resulting RSS-feed can be used with the SmartSlider 3 RSS-connector.