Sourcerer

Problem moving code to Sourcerer from "Blank Module"

3 months 4 days ago #91485

Steve Goodwin's Avatar Steve Goodwin

Hi
I used to use the old 'Blank Module' fncluding source code but it is no longer supported so trying sourcerer.

The code which i'm putting in an otherwise empty custom module is...

{source} 
<script type="text/javascript" language="JavaScript" src="https://www.biblegateway.com/votd/votd.write.callback.js">
</script>
<table><tr><td>&nbsp;</td><td width=40% align='center'>
<script type="text/javascript" language="JavaScript" src="https://www.biblegateway.com/votd/get?format=json&version=NRSVA&callback=BG.votdWriteCallback">
</script>
</td><td>&nbsp;</td></tr></table>
<!-- alternative for no javascript -->
<noscript>
<iframe framespacing="0" frameborder="no" src="https://www.biblegateway.com/votd/get?format=html&version=NRSVA">View Verse of the Day</iframe>
</noscript>
{/source}

In the original version, this retrieved the relevant text and displayed it in a smallish box (created by the table) mid screen.
However, with Sourcerer, I just get one single long line of text way wider than the screen.

Looking at the source code of the 2 versions, the only difference is that the Sourcerer version is wrapped in <pre>...</pre> while the other one is wrapped in <div>... </div>

Any ideas?
Thanks

3 months 4 days ago #91490

Peter van Westen's Avatar Peter van Westen Admin

Check if the scripts/html you are placing via Sourcerer are placed correctly in the html output of your site.
If so, Sourcerer is doing what it should.
How those scripts work (or fail) is outside the control and responsibility of Sourcerer.

The difference in the way things are displayed are probably down to css.

3 months 4 days ago #91496

Steve Goodwin's Avatar Steve Goodwin

It's odd. This is the code produced by sourcerer (found by viewing source in the browser)

<pre>
<script type="text/javascript" language="JavaScript" src="https://www.biblegateway.com/votd/votd.write.callback.js">
</script>
<table><tr><td>&nbsp;</td><td width=40% align='center'>
<script type="text/javascript" language="JavaScript" src="https://www.biblegateway.com/votd/get?format=json&version=NRSVA&callback=BG.votdWriteCallback">
</script>
</td><td>&nbsp;</td></tr></table>
<!-- alternative for no javascript -->
<noscript>
<iframe framespacing="0" frameborder="no" src="https://www.biblegateway.com/votd/get?format=html&version=NRSVA">View Verse of the Day</iframe>
</noscript>
</pre>

The only difference in the code produced by the old extension is the the <pre> and </pre> are <div> instead.
If I save the "View Source" as an html file and just change the <pre> to <div> then it all works correctly.

Is it 'normal' that Sourcerer wraps in <pre>??
Thanks
Steve

3 months 4 days ago #91497

Peter van Westen's Avatar Peter van Westen Admin

Are you using a WYSIWYG editor? You should.
The <pre> tags INSIDE the {source} tags will be stripped by Sourcerer.
So you probably did something with copy/pasting causing <pre> tags to be around the {source}...{/source} tags themselves.

3 months 4 days ago #91502

Steve Goodwin's Avatar Steve Goodwin

Hi Peter,
Yet again, you are right!
JCE seems to have added the <pre>. Removing it in the 'code view' of JCE sorted the problem.
Thanks again
Steve