Search

A new extension, “Unpublished Filter” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Good idea, Nils.

Yes, cool!

But are you really sure that this should work with Symphony 2.0.7? I only got it working on 2.0.8.

It should work in Symphony 2.0.7 as this is the first version offering localisation support for JavaScript. Or am I mixing up things?

Are you getting any errors, Michael?

Nope, no errors in the console.

Do you have a 2.0.7 installation? Or is anybody else willing to test it on 2.0.7?

I don’t have a 2.0.7 install so the compatibility was just a guess - I’ll change it to 2.0.8 for the moment. Maybe there has been an jQuery update in between the versions that breaks compatibility?

I don’t have a 2.0.7 install so the compatibility was just a guess - I’ll change it to 2.0.8 for the moment.

Since 2.0.8 will be the stable 2.0 version, this is fine for me. (I have to update those websites anyway…)

It’s strange though that it doesn’t work. It just a 20 line JavaScript file that doesn’t do anything mystical so it should work in 2.0.7 without any problems.

If you don’t mind debugging the code a bit, you could replace the file symphony.unpublishedfilter.js with the following and see what is prompted in the console:

jQuery(document).ready(function() {

    // Language strings
    Symphony.Language.add({
        'No': false,
        'published': false
    });
    console.log('dictionary', Symphony.Language.DICTIONARY);

    // Publish field index
    var index = jQuery('table thead th:contains(' + Symphony.Language.get('published') + ')').index();
    console.log('index', index);

    // Gray out unpublished entries
    jQuery('table tr').find('td:eq(' + index + ')').each(function(index, element) {
        console.log('value', jQuery(element).text());
        if(jQuery(element).text() == Symphony.Language.get('No')) {
            jQuery(this).parent().addClass('inactive');
        }
    });

});

Nils, your debug code pointed me in the right direction: The problem seems to be that in 2.0.8 the table cell looks like:

<td>No</td>

while in 2.0.7 it looks like this:

<td>No
    <input name="items[4460]" type="checkbox">
</td>

I don’t really know what this input element inside the table cell means… (I don’t see it in the browser.) But I think: To make your code compatible with 2.0.7, you would have to check if the element contains the language expression.

I don’t care too much, to be honest. I suggest to leave it as it is. Everybody should update (websites/extensions/whatever) to 2.0.8 once it is available.

For reference: the hidden input is used to store the “selected” state of rows for when the form is submitted using the “With Selected” dropdown actions. The input should be found either in the first or last cell of each row.

Ah - that makes sense. So this should be an issue in both version then (Symphony 2.0.7 and 2.0.8). I’ll change my script accordingly.

Thanks, Nick!

Unpublished Filter updated to version 1.1 on 21st of June 2010

It works perfectly now in 2.0.7 as well. Thank you, Nils.

No problem - I didn’t notice this issue as I had a section link that was showing up as the last column in my index overview (which is the place the hidden input normally resides).

You know my “talent” — of course it was the last column in my case, without any intention…

Symphony needs “talented” people — dafür haben wir Dich doch, Michael :)

Nils, the version number in the extension driver is still 1.0.

:-)

Du bist echt unglaublich! I’ll fix that …

Edit: fixed

Du bist echt unglaublich!

I hope that “being unbelievable” is s.th. good.

It certainly is :)

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details