WordPress.org

Forums

Posts in Sidebar
[resolved] A few requests (9 posts)

  1. cilya
    Member
    Posted 2 years ago #

    Hi,

    i've been using your plugin on a website and it's been a quitez effortless so far. So thanks for the work :)

    Anyway, I've been asked to do some changes on said website, and i'd like to use PIS for it. However, the plugin, as it is now, can't answer these requests. I've figured if I posted them here, some of it could make it on a future release !

    • HTML Tags: It might be the only "mistake" I could find so far. When listing posts and activating the link toward the taxonomy (category, in my case) archive, it generates wrongly-formed HTML according to the w3c specs. I've illustrated my point here : http://jsfiddle.net/JbSKp/1/.
    • Ease the styling process: still on these archives' links, I would love to be able to set some custom css classes for it (on the tag, precisely).
    • How the widget behaves when there's no post: ATM, when there are no posts to be displayed, an alternative text message is displayed advertising the lack of it. However, what I would need is that the widget does not appear altogeteher.

    I think that's all for today. Thanks in advance for considering it !

    PS : Also, I've tested the updated french translation, but I'm a bit perplexed by some of the translations. Would it be okay if I submit some fixes ? If so, what is the preferred way (a new ticket on WP's trac, emailing my version of the .po file,...) ?

    http://wordpress.org/extend/plugins/posts-in-sidebar/

  2. aldolat
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,
    thanks for your question! :)

    1) About the not-well-formatted HTML output, I took a look at the code of PIS and at jsFiddle but I didn't find any problem. Could you tell me more? I found that the only W3C issue is that WordPress adds these tags to the HTML rel attribute for each category link:

    rel="category tag"

    which breaks the W3C validation (category is not a valid tag for rel). But it depends on WordPress. A filter added to the_category hook should solve this.

    2) At this moment you can't add any class to lines but you can exactly target all the output generated by PIS via CSS. Anyway, I just modified the plugin and now you can use a function to add all the modifications you want. For example, to add some custom classes to the tags links (the A HTML element), you can add these lines to your scripts:

    add_filter( 'pis_tag_filter', 'add_class_to_the_term_list' );
    add_filter( 'pis_category_filter', 'add_class_to_the_term_list' );
    
    function add_class_to_the_term_list( $list ) {
        $list = str_replace( '<a href', '<a class="my-class" href', $list );
        return $list;
    }

    This will add class="my-class" to all links inside the lists of the categories and of the tags. In other words, this:

    <a href="#my-link"...

    will become:

    <a class="my-class" href="#my-link"...

    Be advised that this functionality is not yet available in PIS 1.8 (it will be added in 1.8.1 as soon as possible). In the meanwhile you can test it by downloading the plugin from GitHub.

    3) You can disable the alternative message by deleting the standard text, so it won't be displayed. In version 1.8 there's a little bug that outputs the P HTML element even when the text is not set. This will be fixed in 1.8.1.

    4) About the updated French .po file, please send it to my email (you'll find my email address here, near my avatar).

    Bye... and stay tuned for the next update!

  3. cilya
    Member
    Posted 2 years ago #

    Hi,

    Thanks for your reply :)

    1. Regarding the HTML, it was my mistake. The fiddle itself contained an "error", per say, that corrected what I tried to demonstrate (I mixed up the copy/paste !)... Sorry about that ! Here is the updated link : http://jsfiddle.net/JbSKp/4/.
    To be more precise, what's problematic is the <p class="archive-link"> which is a direct child of the <ul class="pis-ul">. The w3c Specs allow only <li> as children elements of an <ul>.

    2. Thanks for your reactivity ! I'll try to check this out today and I'll give you a feedback ASAP.

    3. Yep, seen that, works like a charm ! But what I meant was to make all the widget markup & content disappear altogether, meaning the alternative text and the widget title, when there's no post to display.

    4. Same as #2 ; I'll try to send it to you ASAP !

    Have a nice day !

  4. aldolat
    Member
    Plugin Author

    Posted 2 years ago #

    1. Sure that's a bug. My fault. I'll fix it in 1.8.1. Sorry for that.

    2. I need your feedback! :D

    3. Unfortunately, it's not possible to hide all the markup because some parts of the widget are echoed before the main function is fired.

    4. Ok, I'll add your name in the changelog and I hope to add all the contributors in the description of the plugin's main page (it's so bare bones at this moment...!).

    Thank you so much!
    Bye.

  5. cilya
    Member
    Posted 2 years ago #

    1. Thanks for the fix !

    2. Works like a charm, as far as adding CSS classes is concerned (I haven't tested the filters for other cases).
    2.1 If I may request another filter, I'd love to have one to target the archive link... I'm crossing my fingers on this one :)

    3. Too bad ! I'll make do with what I have at disposal, no worry.

    4. Oh, thanks for that ! I'll try to send you the l10n file tonight (CEST hours).

    Thx ! (I write that a lot it seems... !)

  6. cilya
    Member
    Posted 2 years ago #

    The updated french translation has just been sent !

  7. aldolat
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for your work, cilya! :)

    About your 2.1 request, I'll add apply_filters where it will be possible, including the archive link. Stay tuned for the stable 1.8.1 version (the 1.8.1 on GitHub is in active development).

    If we have finished with this post, could you mark it as resolved?

  8. cilya
    Member
    Posted 2 years ago #

    Can't wait for the 1.8.1. Thanks a lot !

    This is officially resolved :)

  9. aldolat
    Member
    Plugin Author

    Posted 2 years ago #

    Cilya,
    the version 1.9 is live now. Test it! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts in Sidebar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic