Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1001657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:42:35+00:00 2026-05-16T07:42:35+00:00

I have a Drupal view which should output a video player using flash. I

  • 0

I have a Drupal view which should output a video player using flash. I am trying to output a script that will call the flash film. The problem is that Views applies some sort of filter that strips my <script> tags, the opening and the closing one. I am searching a solution (some setting in views that will disable that filter), but cannot seem to find an answer. Other HTML tags work, but it seems the script tag is being stripped, probably for some security reason.

I have selected the option to rewrite the output of the field and I am using the tags correctly

Views also strips style attributes from my tags. For example:

<h3 style="border-bottom: solid 1px #ffcc99;">Some text here</h3>

appears like this:

<h3>Some text here</h3>

Is there a solution for this? Thank you.


Begin edited


I am pasting below the code I am using in my view.

<div class="bloco-filme">
  [title]
  <div class="field-imagem">
    [field_imagem_fid]

    <script type='text/javascript' src='sites/default/files/js/swfobject.js'></script>

    <div id='mediaspace[nid]'>Se você estiver visualizando esta mensagem, significa o Flash Player não está instalado em sua máquina. Para assistir ao vídeo é preciso instalar o Flash player</div>

    <script type='text/javascript'>
      var so = new SWFObject('sites/default/files/plugins/jqplayer/player.swf','mpl','205','undefined','9');
      so.addParam('allowfullscreen','true');
      so.addParam('allowscriptaccess','always');
      so.addParam('wmode','transparent');
      so.addVariable('file','[field_video_fid]');
      so.addVariable('quality','false');
      so.write('mediaspace[nid]');
    </script>
    [field_video_fid]
  </div>
  <div class="field-resumo">
    <p>[body]</p>
  </div>
</div>

Edited again


The code above is beinng posted in my view. I have created a view to handle this. This is the FIELDS area of my view:

Fields
Node: Nid
Node: Título (title, it is in pt-br)
Node: Link “editar” (edit)
Node: Link “apagar” (delete)
Conteúdo: Imagem thumbnail image
Conteúdo: Video URL do arquivo (video file URL)
Node: Corpo (Body)

I have disabled the display of all the fields above and have packed all the code in the Body field. There I selected the option that I want to rewrite the output of the field.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:42:36+00:00Added an answer on May 16, 2026 at 7:42 am

    kiamlaluno identified the basic problem, but to solve it, you’re going to have to use a field template which will avoid using the filtering system Views uses. Group 42 has a great guide to walk you through the basics of Views theming, so I’ll just gloss over those details and talk about your specific case.

    First, you need to identify which field you want to rewrite: I believe you’re doing that using the Field configuration, but it’s not clear which field you are rewriting. I’m going to assume it’s the body field. Go through Group 42’s guide to create a new template file for the body field in your theme.

    In the new template file, use the following code:

    <div class="bloco-filme">
      <?php print $view->field['title']->render($row) ?>
      <div class="field-imagem">
        <?php print $view->field['field_imagem_fid']->render($row) ?>
    
        <script type='text/javascript' src='sites/default/files/js/swfobject.js'></script>
    
        <div id="mediaspace<?php print $view->field['nid']->render($row) ?>">Se você estiver visualizando esta mensagem, significa o Flash Player não está instalado em sua máquina. Para assistir ao vídeo é preciso instalar o Flash player</div>
    
        <script type='text/javascript'>
          var so = new SWFObject('sites/default/files/plugins/jqplayer/player.swf','mpl','205','undefined','9');
          so.addParam('allowfullscreen','true');
          so.addParam('allowscriptaccess','always');
          so.addParam('wmode','transparent');
          so.addVariable('file','<?php print $view->field["field_video_fid"]->render($row) ?>');
          so.addVariable('quality','false');
          so.write('mediaspace<?php print $view->field["nid"]->render($row) ?>');
        </script>
        <?php print $view->field['field_video_fid']->render($row) ?>
      </div>
      <div class="field-resumo">
        <p><?php print $output ?></p>
      </div>
    </div>
    

    Save your new template file, and now the body field will be replaced with the correct output. Just make sure all the fields you’ve referenced in the template are before the body field within the Fields list when you edit the View.

    You can see that this is mostly HTML with a few PHP bits. Code like this:

    <?php print $view->field['title']->render($row) ?> 
    

    outputs the contents of a field other than current one (i.e. you use this code when you want to reference fields other than Body). It references the same row and finds the value of the field.

    And code like this:

    <?php print $output ?> 
    

    Outputs the value of the current field, in this case, Body.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Drupal 6. I have a custom view that needs to be filtered
I have a Drupal view that displays vacation leaves for a particular employee. I
I have Drupal 6 website which is using FCK Editor as HTML editor. It
I'm using Drupal . I have a module which loads a form onto a
I have a Drupal view that lists a node called publication. At the top
I have a View which is a series of images. I need the output
In Drupal 7, I'm trying to have an athlete (which is a content type)
I have a Drupal 6 site where I've created a view that shows a
I have a drupal view which pulls out project screen shots and puts them
I have a view of nodes in drupal. Each node has button which (is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.