We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: Encaf Bible Verses - Show bible verses from the ESV API

Development and Programming

Chad Crowell's avatar
Chad Crowell
242 posts
16 years ago
Chad Crowell's avatar Chad Crowell

I found Scripturizer after I wrote this, and frankly I think this version is more slick.

Allows you to show bible verses on your web page from http://www.esvapi.org/ by feeding in the verse information.

Place any number of verses in the ‘verses’ variable, with each verse separated by a semicolon. See the example below for formatting. Be sure to go to http://www.esvapi.org to register for an API key, which you will need to supply in the key parameter.

{exp:wi_bible_text verses="Exodus 3:1; Romans 12:9-21; Psalm 100; Matthew 25:31-46" key="my_api_key"}

Or, even better, use a custom field to supply the verse info:

{exp:wi_bible_text verses="{my_custom_field}" key="my_api_key"}

To see this in action, visit any sermon on this site: Bellevue First Congregational Church

Here is a link to the CSS that ESV provides to help format the returned verses nicely. Just add it to your CSS file, and tweak it as you see fit. http://www.gnpcb.org/esv/assets/style/text.css

EE1 and EE2 versions now available at Devot-EE http://devot-ee.com/add-ons/encaf-bible-verses/

       
russlipton's avatar
russlipton
305 posts
16 years ago
russlipton's avatar russlipton

Obtained an esv key and tested, using exact same syntax as your example, but with my key.

Receive ‘following tag has syntax error’ for the bible text tag. To confirm, tested plugin in a clean EE install with no extra modules, extensions or plugins: received same error message.

Any clues?

       
Chad Crowell's avatar
Chad Crowell
242 posts
16 years ago
Chad Crowell's avatar Chad Crowell

Hi russlipton-

I can’t say I’ve seen that error - it is generated from ESV, not the plugin. Have you tried some other test verses? That example, by the way, I patched together from several real sermons being used on the site- so theoretically there could be a syntax error but it looks fine to me.

This API page may have some info about errors- http://www.esvapi.org/api let me know if you find anything I can take a look at the plugin again.

       
russlipton's avatar
russlipton
305 posts
16 years ago
russlipton's avatar russlipton

I’m stumped - still retrieving the syntax error message.

I can retrieve verses with my key using a hard-coded query:

&passage=John+1”]John 1

I fooled around a bit with your code, but it’s pretty straightforward and I can’t find a problem so far. No zen moments with the API doc either. It’s a shame. I can make this work functionally without your plugin, but that’s no fun.

       
Chad Crowell's avatar
Chad Crowell
242 posts
16 years ago
Chad Crowell's avatar Chad Crowell

I’m trying to remember if I had to have something installed on my server to get this going- I’ll look at my old support requests to my host and see if that jogs my memory.

       
Chad Crowell's avatar
Chad Crowell
242 posts
16 years ago
Chad Crowell's avatar Chad Crowell

hey russlipton-

I think you need to have SOAP installed on your server. Give that a try. Just compile PHP with SOAP. That might have been it.

       
russlipton's avatar
russlipton
305 posts
16 years ago
russlipton's avatar russlipton

Installed SOAP; confirmed by PHP info in EE admin, but receive same syntax error. Do we know of anyone who has downloaded this plug-in for whom it is working?

       
Chad Crowell's avatar
Chad Crowell
242 posts
16 years ago
Chad Crowell's avatar Chad Crowell

Sorry to hear it. I’ll put it in a clean install and debug it when I get a chance, but I don’t know if that will be today. Pretty full day planned…

       
Chad Crowell's avatar
Chad Crowell
242 posts
16 years ago
Chad Crowell's avatar Chad Crowell

Hey Russ - turns out this was a stupid mistake on my part- I renamed the plugin to release it publicly but did not update the instructions. The plugin call should be

{exp:wi_bible_text verses="{my_custom_field}" key="my_api_key"}

Let me know if that works. I’ll update the plugin. Sorry for the delay.

       
Simon Job's avatar
Simon Job
123 posts
16 years ago
Simon Job's avatar Simon Job

Chad, thanks for this plugin. I must have missed it when it was released.

I’ve been using CURL to grab the ESV for a while, but hadn’t thought of putting it into a plugin. I’ve just replaced my PHP chunk with your plugin.

e.g. http://www.toongabbieanglican.org.au/bibletalks/snc/a-good-god-in-a-cruel-world/

Thanks!

       
Chad Crowell's avatar
Chad Crowell
242 posts
16 years ago
Chad Crowell's avatar Chad Crowell

Glad it worked for you Simon!

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Chad, can this be used with BibleGateway.com?

       
Chad Crowell's avatar
Chad Crowell
242 posts
16 years ago
Chad Crowell's avatar Chad Crowell

No, BG.com only allows placing info on your site via Magpie RSS. The API is totally different.

       
the_crimsonrooster's avatar
the_crimsonrooster
264 posts
15 years ago
the_crimsonrooster's avatar the_crimsonrooster

chad,

how are you handling the audio??

       
Chad Crowell's avatar
Chad Crowell
242 posts
15 years ago
Chad Crowell's avatar Chad Crowell

@therooster, the audio playback is delivered with the data returned from the API. The options in the API allow you to disable it and autoplay it, typical audio features on the web. But it is returned automatically with the textual data from the API.

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.