Counter Format Issue

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm

Re: Counter Format Issue

Post by JohnnyB »

Oh wait. I don't think using the "Preview" tab when editing a page is always the best way to tell if an iframe works. I think the preview tab is an iframe already so, it might be a conflict.

I would test going to the actual page. I personally never use the preview tab since browsers support multi-tab interfaces.

But, I added the iframe snippet to a GCB and then placed the GCB into a page and everything works fine for me. I used a template that is barebones to make it easy to see the source. I also tried with the sandbox attribute and that worked good too.

Code: Select all

<!doctype html> 
<__html lang="en" class="no-js">
<head>
<meta charset="UTF-8">
<base href="http://www.NothingHere.....ToSee.org" />
<title>Site Title</title>
<meta name="Robots" content="noarchive, nofollow">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="canonical" href="http://www.NothingHere.....ToSee.org"></head></__body>
<!-- pageAttribute: NotSearchable -->
<__iframe src="http://www.census.gov/popclock/embed.php?component=counter&popclk=727707" frameborder="0" width="389" height="930" allowtransparency="true" sandbox="allow-same-origin allow-scripts">
</__iframe><__body>
</__html>
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: Counter Format Issue

Post by KitchM »

Is the code you displayed the actual code that goes in the GCB?
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm

Re: Counter Format Issue

Post by JohnnyB »

no, that was just the view source of the html page.
This is the final version I used, but all of them worked ok
<__iframe src="http://www.census.gov/popclock/embed.ph ... clk=727707" frameborder="0" width="389" height="930" allowtransparency="true" sandbox="allow-same-origin allow-scripts">
</__iframe>
(without the __ before the element names that the forum adds in for security... not this, <__iframe
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: Counter Format Issue

Post by KitchM »

Please take a quick look at my page at:

https://www.sierraclubswmg.org/index.ph ... Population

and tell me what's wrong. It is so different from my source that there is no comparison for me.

Thank you very much.
JohnnyB
Dev Team Member
Dev Team Member
Posts: 731
Joined: Tue Nov 21, 2006 5:05 pm

Re: Counter Format Issue

Post by JohnnyB »

Try disabling the SSL / https for that page under the page's Options while editing it. Maybe that bad SSL certificate is causing a problem for the iframe to load since the iframe's source may also encounter a SSL crt error.
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo

--
LinkedIn profile
--
I only speak/write in English so I may not translate well on International posts.
--
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Counter Format Issue

Post by velden »

Make the iFrame src https and it will probably work.

Browsers don't like mixed content like this.

Code: Select all

 <__iframe src="https://www.census.gov/popclock/embed.php?component=counter&popclk=727707" frameborder="0" width="389" height="930" allowtransparency="true" sandbox="allow-same-origin allow-scripts">
</__iframe>
or

Code: Select all

 <__iframe src="//www.census.gov/popclock/embed.php?component=counter&popclk=727707" frameborder="0" width="389" height="930" allowtransparency="true" sandbox="allow-same-origin allow-scripts">
</__iframe>
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: Counter Format Issue

Post by KitchM »

Well, I'll be....... It works!

So, if I want to use HTTPS, what should I change to make that work? Does the link need to be that way as well?

Besides, why does it matter that I drag that content into my secure page? It shouldn't matter where it comes from, should it?
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Counter Format Issue

Post by velden »

Of course it matters. When you tell the browser (and visitor) you're serving over https, but in the background you don't, that's not fair play.

Search the web for 'mixed content' and you'll probably find a lot of decent explanations. I don't know all the ins and outs about this subject.

By the way: skipping the 'http:'/'https:' from the url will make it 'inherit' the protocol from the containing 'page'. Note however that (of course) the included source (iframe, image, stylesheet, js, whatever) must then be served too with the same protocol.

In this particular case, the content is both served as http and https. However, often that's not the case.
KitchM
Power Poster
Power Poster
Posts: 328
Joined: Mon Dec 02, 2013 3:26 am

Re: Counter Format Issue

Post by KitchM »

Thanks for the good info.

What I meant was that if mine is secure, their's should be secure because mine contains it.

I will experiment and see what happens and report back.
Post Reply

Return to “Layout and Design (CSS & HTML)”