• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 121
  • Last Modified:

Programming

I have been asked to add the following to our existing web site to add a web pixel for banner ads.  We are currently using drupal (that someone else created) and I have no idea how to make this work.  When I paste into the ckeditor on the site using Edit, I only get the text as it appears and it does nothing.  I believe the idea is to add some banners to our web page, but I am not sure as I have not heard back from the vendor asking us to do this.  Please advise.

Here is the code.

<!-- Segment Pixel - JRC 7596 ...  http://www.... - DO NOT MODIFY -->
<script src="https://secure.adnxs.com/seg?add=1926001&t=1" type="text/javascript"></script>
<!-- End of Segment Pixel -->

Help!
0
manch03
Asked:
manch03
  • 3
  • 2
1 Solution
 
quizwedgeCommented:
In general, you don't want to add the script tag in something like ckeditor. They typically disable script tag input for security reasons. It'd be much better to add it somewhere else. That being said, some people have found some workarounds such as turning the WYSIWYG editor off. See https://www.drupal.org/node/1334694 for more details.
0
 
manch03Author Commented:
Where would I add it some place else?  There are options - plain text or html to change to from ckeditor.  I have no experience with this and the link provided talk about adding forms.  I am not adding a form, I only want the script on the main page to enable the web pixel.  Is this a security risk?  If so, I will rethink this.
0
 
quizwedgeCommented:
For the javascript you're trying to add, you should be fine in regards to security. It'd be possible to trick someone into adding something that would be a security risk, which is why it's typically locked down.

You might be able to add that code using plain text or html, but my guess is that you've tried that and it's not working. The Drupal way of doing things seems to have you editing your page.tpl file.

Are you able to manually edit your page.tpl file? If so, you could add those lines there or, to be more standard with what Drupal would have you do add the following line instead

drupal_add_js('https://secure.adnxs.com/seg?add=1926001&t=1', 'external');

Open in new window


Note: I'd back up any files you're going to edit first, just in case something gets messed up.
0
 
manch03Author Commented:
I tried html but not plain text.  I am very inexperienced with any thing of this nature and I do not want to mess anything up.  I tried copying and pasting the code right into the bottom of my text box on the page.  It only shows the text.  I have not tried changing to plain text.  I will try that to see what happens.    I do not know how I would access page.tpl.
0
 
quizwedgeCommented:
I'm familiar with Drupal in that I know it's a content management system based on PHP, but I'm not familiar with the specifics of operating it. It appears that there should be a file called page.tpl.php that you should be able to edit or, if this page does not exist, you should be able to create it so that it is a template.

The easier way to do this - if it exists - may be to see if there is a Drupal module for the service you're using. See https://www.drupal.org/project/project_module
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now