Can't seem to get filter to work

stephthegeek - May 12, 2008 - 21:46
Project:Table Alternate Rows
Version:5.x-1.1
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Please forgive me if I'm missing something incredibly obvious, but I just cannot seem to get this module to do anything.

It's enabled, and set to be used under the Full HTML format in my input filters section. I've tried setting the order so that it's the first or last filter to run, but neither of those worked. I'm using FCK as my WYSIWYG editor, but I have it disabled so am just doing HTML table code by hand. My other input filters are working, and "Tables will be rendered with different styles for even and odd rows if supported." is indeed showing under the input filters while I'm editing my content. But no classes are ever being added to the table in my node.

Is there something that needs to be added to the markup for this to work? Any known issues?

Thanks!

#1

stephthegeek - May 12, 2008 - 21:53

Of course you always figure something like this out just after asking for help :P

Looks like it needs the <thead></thead> and <tbody></tbody> tags. Fine by me but this should probably be in the documentation to save others from some head-bashing.

Thanks for this very handy module!

#2

deviantintegral - May 22, 2008 - 02:29
Status:active» closed

Actually, it just needs a <tbody>, not a <thead>. This is so it doesn't accidentally stripe a heading row. It might be more robust to only use a tbody if a thead is present, so if that's useful to you you're welcome to submit a patch :)

--Andrew

#3

mtz - August 6, 2008 - 16:18
Status:closed» postponed (maintainer needs more info)

Hi there, I'm having the exact same Problem: I am using FCKEditor und want the Table Alternate Rows filter to work with my input format "Filtered HTML". Allowed HTML-Tags amongst others are:

<table> <thead> <tbody> <tr> <td>

But the classes are simply not added. If I submit my content using the input filter "Full HTML" it works fine. I also tried to run the filter first or last but it doesn't help.

What's also strange about it: If I add the classes manually editing the source code and then submit my content using the desired format "Filtered HTML" the classes are added as expected.

Anyone can help me out? Thanks in advance.

#4

deviantintegral - August 6, 2008 - 17:32

I just tested on my D5 test site with FCKEditor and it seems to be working fine. What I did:

  1. Install both FCKEditor and Table Alternate Rows.
  2. Set the HTML filter to be first, and this module to be second in a new input format.
  3. Added <table> <thead> <tbody> <tr> <td> as allowed HTML elements.

This is the following code that was generated from a simple table with FCKEditor:

<table width="200" cellspacing="1" cellpadding="1" border="0">
    <tbody>
        <tr>
            <td>Test</td>
            <td>Test</td>
        </tr>
        <tr>
            <td>Test</td>
            <td>Test</td>
        </tr>
        <tr>
            <td>Test</td>
            <td>Test</td>
        </tr>
        <tr>
            <td>Test</td>
            <td>Test</td>
        </tr>
        <tr>
            <td>Test</td>
            <td>Test</td>
        </tr>
    </tbody>
</table>

Is there any other HTML in your table which could be interfering?

--Andrew

#5

mtz - August 8, 2008 - 12:36

Thanks for your support.

In order to double-check I followed your steps and additionally I disabled all other filters so that only HTML-Filter and this module were left. Without success unfortunately.

FCKEditor produces the following HTML-Code:

<table width="200" border="0" cellpadding="1" cellspacing="1">
    <tbody>
        <tr>
            <td>asd</td>
            <td>asd</td>
        </tr>
        <tr>
            <td>asd</td>
            <td>asd</td>
        </tr>
        <tr>
            <td>asd</td>
            <td>asd</td>
        </tr>
    </tbody>
</table>

And still there is this strange behaviour that when i add <tr class="odd"> or <tr class="even"> manually to the tags it works just fine with the input format... I'm pretty lost.

#6

deviantintegral - September 4, 2008 - 19:35

Just to confirm, you added <table> <thead> <tbody> <tr> <td> as allowed HTML elements? I assume it works if you disable the html filter?

#7

deviantintegral - September 9, 2009 - 02:22
Status:postponed (maintainer needs more info)» closed
 
 

Drupal is a registered trademark of Dries Buytaert.