HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Adense

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#69109 (In Topic #14645)
Avatar

Well-settled

Code removal

Just trying to put a Google adsense banner right below my greeting and above my news.

I definitely don't want any banner in my header, as this ruins the header image.

Here is the code I enter:

<script type="text/javascript"><!–
google_ad_client = "ca-pub-8319053965494485";
google_ad_slot = "3173295389";
google_ad_width = 120;
google_ad_height = 240;
//–>
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

Here is the code after I save and return to the edit:

<script type="text/javascript">
</script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript">
</script>

ocPortal keeps removing the most important details, and so I will see a glimpse of something white… and then it disappears. The part before this code goes missing.
Any idea why this is?

And also, I'd like really have a Google adsense banner on top of every page, specifically in my video/photo gallery.. do I just edit one of the gallery templates and insert the code someplace?
Back to the top
 
Posted
Rating:
#69110
Avatar

Avoid entering Javascript code in the WYSIWYG editor, it's not likely to get preserved. If you need it in a portion of Comcode you need to turn the WYSIWYG editor off first then use Comcode 'html' tags.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#69114
Avatar

Well-settled

Hey Chris.

I had disabled the WYSIWYG editing.

So here is my code:


Code

[semihtml][title="1"]Welcome to {$SITE_NAME*}[/title]

 [block=&quot;3&quot;]main_greeting[/block]
[html]<script type="text/javascript"><!--google_ad_client = "ca-pub-8319053965494485";google_ad_slot = "3173295389";google_ad_width = 120;google_ad_height = 240;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>[/html]<br /><br /><br />[block]main_news[/block]
<br /><br />[block]main_quotes[/block]
<br /><br />[block=&quot;video&quot; efficient=&quot;1&quot; title=&quot;Random Video&quot; zone=&quot;_SEARCH&quot; mode=&quot;random&quot; failsafe=&quot;1&quot;]main_content[/block]
<br /><br /><div class="float_surrounder" style="outline-color: initial; outline-style: initial; outline-width: 0px; overflow-x: hidden; overflow-y: hidden; width: 652px"><div class="fp_col_block" style="float: left; width: 313px"><br class="Apple-interchange-newline" /><span class="ocp_keep_block" style="background-color: rgb(186, 186, 255); display: block; font-weight: bold">[block failsafe=&quot;1&quot;]main_iotd[/block]
 </span></div><div class="fp_col_block" style="float: right; width: 313px"><span class="ocp_keep_block" style="background-color: rgb(186, 186, 255); display: block; font-weight: bold">[block failsafe=&quot;1&quot;]main_poll[/block]
[block]main_comcode_page_children[/block]
 </span></div></div>[/semihtml]


I get this error:



There is an error (The tag html was closed but it was not the last tag in that level to be opened, which wassemihtml) in your Comcode at line 6.


Removing semihtml from the beginning and end shows all the br / codes and HTML codes, so that probably should be left in.

So replacing the . html . tags with semihtml leads me to this error:

There is an error (A syntax error was found inside a tag's attribute definition (attribute Video" of tagblock)) in your Comcode at line 20.

So I'm assuming it's having trouble reading the &quot tags. So removing these and replacing them with: "" then takes me to this error:


There is an error (The tag, semihtml, was closed, but it was not opened) in your Comcode at line 25.

And obviously, if I remove that last tag, I am right back to the beginning of HTML code showing up.
Back to the top
 
Posted
Rating:
#69115
Avatar

I would start again with the WYSIWYG off. It's good for document authoring, but any WYSIWYG error will make awful markup. Comcode is a lot cleaner and easier to understand, or if you prefer, custom coded HTML (all in one 'html' Comcode tag).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#69116
Avatar

Well-settled

Should I just start from complete scratch? And add the Comcodes for the content later?

I had tried just adding the adsense code two or three times with the WYSIWYG mode off. But hadn't removed everything else.
Back to the top
 
Posted
Rating:
#69117
Avatar

Just that page, shouldn't take very long.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#69119
Avatar

Well-settled

I think I will just figure out another place to put it. The WYSIWYG editor even when turned off doesn't like that adsense code, so even after clearing everything out.. I'm not really getting anywhere fast, but running into the same errors, or removal of code.

Even tried putting the adsense in the menu bars on the side and was not successful.

Adding directly into the Templates, however, was more successful, at least I could see the ads being displayed, when I put the code back into the header.

Just not where I want it to display, but I'll work around it and figure it out.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: