WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Parsnip

Include HTML snippets from other sites in your own site

There is no general configuration, the plugin works simply with short codes. In the following example we will demonstrate how to parse a FAQ section of our own FAQ running on WHMCS into our WordPress site.

You can use shortcodes in the following format:

[parsnip level="..." url="..." pre="..." selectors="..."]

  • url: the URL you want to get a HTML snippet from, for example "http://go.zingiri.com/knowledgebase/1019/Bookings"
  • pre: the first part of the URL "http://go.zingiri.com"
  • selectors: the jQuery style selectors to retrieve the portion of the HTML page that we want, for example ".contentpadded .row". They can be comma separated in case you want to use multiple selections on the page. We use the phpQuery library for this, you will find more example on their site.
  • level: parsing level, we'll come to this later

So this would give:

[parsnip url="http://go.zingiri.com/knowledgebase/1019/Bookings" pre="http://go.zingiri.com/" selectors=".contentpadded .row"]

And this would display all the FAQ's for our Bookings plugin.

Now we want to go a step further and be able to follow the links as well, for this we will use the 'level' attribute.

[parsnip level="2" url="http://go.zingiri.com/knowledgebase/1019/Bookings" pre="http://go.zingiri.com/" selectors=".contentpadded h2,.contentpadded blockquote"]

Note that both [parsnip] short codes go together on the page like this:

[parsnip url="http://go.zingiri.com/knowledgebase/1019/Bookings" pre="http://go.zingiri.com/" selectors=".contentpadded .row"] [parsnip level="2" url="http://go.zingiri.com/knowledgebase/1019/Bookings" pre="http://go.zingiri.com/" selectors=".contentpadded h2,.contentpadded blockquote"]

You will now be able to view the Bookings FAQs and also to open individual links.

Requires: 3.4 or higher
Compatible up to: 3.5.2
Last Updated: 2013-5-22
Downloads: 232

Ratings

0 stars
0 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.