solved Trying to add a java slider to a blog post...strips out code

Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
I have (master admin owned) blogs as content blocks on my main index page.
I'm trying to add this into the blog post:
<div id="comslider_in_point_823921"></div>{literal}<script type="text/javascript">var oCOMScript823921=document.createElement('script');
oCOMScript823921.src="http://commondatastorage.googleapis.com/comslider/
target/users/1447352950xa2b1470221aa399daeca6cffd78d9e61/comslider.js?timestamp=1447360143";oCOMScript823921.type=
'text/javascript';document.getElementsByTagName("head").item(0).appendChild(oCOMScript823921);
</script>{/literal}

(I put the "literal" tags in myself)
When i save, it keeps stripping out all except the initial div ID part of the code.
Can I get this to work somehow? Is it not allowed? I have all html tag permissions ON (for Master admin only). Sure wish i could insert this simple AD slider into my blog container on my main page...thanks



--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 02/14/16 03:53:28PM
douglas
@douglas
10 years ago
2,802 posts
Have you added script to your allowed HTML tags?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
Yes, I have all this in my Master Admin allowed html tags:
span,strong,em,a,b,u,i,p,div,br,img,h1,h2,h3,h4,pre,hr,ul,ol,li,
big,form,input,iframe,object,param,anchor,table,tbody,th,tr,
td,q,blockquote,cite,image,script

But it keeps removing everything in between the two "literal" tags.
Have done cache and integrity check twice.
?



--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 11/12/15 02:46:38PM
brian
@brian
10 years ago
10,149 posts
You don't need the literal tags - remove those.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
Ok, I took out the literal tags... but it's still stripping out the whole 'script,/script' part, and leaving only the initial 'div/div' part. See the code above, but without the 'literals'.
This is within a blog post, in the html code.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
brian
@brian
10 years ago
10,149 posts
Strumelia:
Ok, I took out the literal tags... but it's still stripping out the whole 'script,/script' part, and leaving only the initial 'div/div' part. See the code above, but without the 'literals'.
This is within a blog post, in the html code.

So you're clicking on the small "source" button then adding it in that way?


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
Yes, the 'source code' button in the editor, for editing the blog post.

(should mention- have not gone to the new Core beta)





--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 11/12/15 05:57:35PM
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Have you tried adding
<div id="comslider_in_point_823921"></div>
in the Template editor then create a template called comslider.tpl and add this code in the template
<script type="text/javascript">var oCOMScript823921=document.createElement('script');
oCOMScript823921.src="http://commondatastorage.googleapis.com/comslider/
target/users/1447352950xa2b1470221aa399daeca6cffd78d9e61/comslider.js?timestamp=1447360143";oCOMScript823921.type=
'text/javascript';document.getElementsByTagName("head").item(0).appendChild(oCOMScript823921);
</script>
so the code in the editor would look like
<div id="comslider_in_point_823921"></div>{jrCore_include template="comslider.tpl"}

I know its not the answer you want or the outcome you expect-but it seems like I had to do this once awhile back to keep a script in there...just a thought
michael
@michael
10 years ago
7,791 posts
Strumelia:.....into my blog container on my main page..
Which page is this?

I think there is some confusion as to whether this code is being entered into a template or into a blog post.
updated by @michael: 11/12/15 09:23:30PM
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
Thanks guys-
pictures will explain:
Here is the place on my site's main page where I want the slider to be- within a static blog post:
mainpage-blog.jpg
mainpage-blog.jpg  •  624KB




--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
And here is where I UPDATE that blog post, and where I'm trying to add the slider code above:
updateblog.jpg
updateblog.jpg  •  207KB




--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
brian
@brian
10 years ago
10,149 posts
This is being stripped out by the WYSIWYG editor - not Jamroom. I'm looking to see if there is a way to make this work, but I'm not sure at this point.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
Darn! I know I managed to put the Paypal Donation button in those Blog posts, I think it was enabled by adding "form" to the allowed html tags for admin. But I guess that was a simpler task.
I've been putting it off too long to finally offer some ad slots in a slider in that location, in a way that I could easily edit. I actually have two eager customers lined up already just waiting to pay for their slider slots. (I heard tell there are tens of dollars to be made in Dulcimer Land)

If you are able to figure this out, I'd be thrilled.

P.S- I tested this slider on another website page, and it works great. Plus it was free.



--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 11/13/15 08:23:36AM
brian
@brian
10 years ago
10,149 posts
Form tags work because they are not script tags :) script tags are MUCH more dangerous embedded, so you want to be very careful that you do not allow script tags in any quota that has users in it that you do not trust 100% with your site.

I've got this working for 5.3.0b3.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 11/13/15 08:26:43AM
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
Yes thanks- I do understand the part about dangerous tags- I have very limited tag permissions for everyone except just me as Master Admin.

So you have enabled me to allow script tags for chosen quotas in the new JR BETA Core update, correct? That will be awesome!! :)

I've been fussing with this slider code meanwhile, and was able to get an iframe code that seems to be working on my site in that blog module. I'm supposing it's not inadvisable to use iframes that way? It seems to be working ok on my PC desktop and on my iPad.
This is the iframe code I'm using for now instead of the script code...can you tell me if it seems ok to you?:
<p><iframe id="comslider_iframe_823921" style="border: 0px; margin: 0px auto; 
overflow: hidden; display: block;" src="http://commondatastorage.googleapis.com/comslider/target/users/
1447352950xa2b1470221aa399daeca6cffd78d9e61/comsliderframe823921.html" width="100%" height="200" scrolling="no"></iframe></p>



--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015

updated by @strumelia: 11/13/15 10:44:28AM
brian
@brian
10 years ago
10,149 posts
Yes - that should work - as long as:

- you have "iframe" in the Allowed HTML
- "commondatastorage.googleapis.com" has been added as an allowed domain in the iFrame Control

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
OK I have done the above Brian.
QUESTION- in the iFrame Control module settings, should I add a checkmark to enable "Validate Iframe Domains" ? (the default is UNchecked)

So here is the final result for my rotating ads slider, using the iframe code instead of the script code. I like that all I had to do was paste in a little code chunk, in only an html text editor.
Seems to be working fine and is responsive. I put a few 'filler' sample ads in for now.
It's at the bottom right of my site Main Page here: http://fotmd.com/


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
P.S. Brian I notice that since your updates of the past day or two, when we paste in [ code ] in tags here, they no longer wrap, and tend to overflow to the right in the forum. See near the top of this thread. The last one I 'wrapped' myself by inserting line breaks.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
brian
@brian
10 years ago
10,149 posts
Strumelia:
P.S. Brian I notice that since your updates of the past day or two, when we paste in [ code ] in tags here, they no longer wrap, and tend to overflow to the right in the forum. See near the top of this thread. The last one I 'wrapped' myself by inserting line breaks.

This is actually correct - long code lines should let you scroll to the right to see them - not wrap (which if a user cuts and pastes they will end up getting a syntax error).


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
Ok, thanks for the clarification on the long code lines. :)

Can you help me understand this one last thing?:
in the iFrame Control module settings, should I add a checkmark to enable "Validate Iframe Domains" ? (the default is UNchecked) not sure if i should check it or leave it empty.


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015
brian
@brian
10 years ago
10,149 posts
It depends - if you are the only one who is allowed to embed an iframe, then you can leave it unchecked - if you want to allow your users to embed iframes, then you want to make sure it is checked AND the allowed domains they can use in their iframes are configured in the "Allowed Domains".


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Strumelia
Strumelia
@strumelia
10 years ago
3,603 posts
Ok, I understand now- thank you!

I'm real happy with my new slider- it's working beautifully now. It's easy to use, customize, and update, and it doesn't cost much.
Thank you so much for helping me figure out the script vs. iframe issues- I've learned quite a few helpful things. :)


--
...just another satisfied Jamroom customer.
Migrated from Ning to Jamroom June 2015