• Resolved belg4mit

    (@belg4mit)


    Hello,

    I have added an — as the before item of the link description however, this is always appended to the link, not merely those links that have descriptions. If one wants the decoration to always appear they can add it to the after of the link, but it seems like before should be conditional on that information being present and displayed.

    Cheers

    https://wordpress.org/plugins/link-library/

Viewing 6 replies - 1 through 6 (of 6 total)
  • For the image, the plugin does omit the before and after when there is no image. I used to have the image wrapped in a TD, and had to make sure each link had an image, otherwise it would screw up my tables. That’s why I think the author chose to output the before and after of the other fields even when empty.

    I did find a workaround by placing the image before code in the after of the preceding field, and the after code in the before of the next field. I’m afraid this is not a solution in your case.

    You could try decorating using css, eg. if you’re displaying as an unordered list you could use list-style-type

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    There is something that needs some re-work here. As yezzz pointed out, some types of items display the before and after code no matter if they contain any data, while other items don’t output anything if they are empty. This can definitely cause problems when the item is empty. I would lean more heavily towards displaying the before and after tags all the time, as they are more often table dividers or just basic html div tags, than content like a hyphen. Perhaps I could add divs around each item with a class indicating if the item contains any data or not, to allow for easy hiding of these undesired sections… Not sure how divs around table data cells would react though…

    Plugin Author Yannick Lefebvre

    (@jackdewey)

    Putting divs around items would not make sense for some HTML content, so I will make it output the before and after tags for all link fields.

    Thread Starter belg4mit

    (@belg4mit)

    Consistency is good, but so is flexibility. Many probably use the unordered list output rather than the table output, so classed spans around the elements (name the same as the section) could work for that… just a thought.

    Thanks for the great plugin!

    You can hide your empty elements with css:

    div:empty {
    display: none;
    }

    You’d need to remove the — from the template and use css before instead:

    div::before {
    content:"—";
    }

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Conditional element decorations in advanced settings’ is closed to new replies.