• CrouchingBruin

    (@crouchingbruin)


    The plugin works great, creates a nice looking PDF file of a post. My only complaint is that the web elements that get written out aren’t well designed, so it’s difficult for us web designers to position the PDF icon without having to create a child theme and muck around with the code.

    For example, if I choose to position the icon to the left, I get this HTML structure for the PDF icon:

    <div style=text-align:left;>
       <a class="wpptopdfenh" target="_blank" rel="noindex,nofollow" href="/2015/04/25/mypost/?format=pdf" title="Download PDF">
          <img alt="Download PDF" src="https://example.com/wp-content/plugins/wp-post-to-pdf-enhanced/asset/images/pdf.png">
       </a>
    </div>

    The wpptopdfenh class should have been moved to the enclosing <div> instead part of the link element. That way, it would have been much easier to position and style the icon.

    Second, the inline style for the enclosing <div> makes it too difficult to override (providing you can target the <div> in the first place). I would have to use an !important clause to override any inline styling.

    A better implementation of the plugin would be to output a structure like this:

    <div class="wpptopdfenh alignleft">
       <a target="_blank" rel="noindex,nofollow" href="/2015/04/25/mypost/?format=pdf" title="Download PDF">
          <img alt="Download PDF" src="https://example.com/wp-content/plugins/wp-post-to-pdf-enhanced/asset/images/pdf.png">
       </a>
    </div>

    And then enqueue an external stylesheet that looks like this:

    .wpptopdfenh.alignleft {
       text-align: left;
    }
    .wpptopdfenh.alignright {
       text-align: right;
    }

    That would make it easier to adjust the positioning of the icon in case I want to adjust it slightly up or down, make it inline-block with some existing elements, etc. If I wanted to style the link itself, I could just use a .wpptopdfenh a selector.

    I hope you will please consider this for your next update.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can have it as manual placement, wrap it inside your own dive class and style it.

    Thread Starter CrouchingBruin

    (@crouchingbruin)

    @rosh8111, but that would mean I would have to create a child theme, which is something probably 90% of WP users don’t want to hassle with, especially if it’s just for one plugin. Better if the plugin output better coding standards to begin with.

    Thread Starter CrouchingBruin

    (@crouchingbruin)

    I could have even used Javascript to move the element around, except the containing <div> doesn’t have a class or ID associated with it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Functionally Great, But Need Better Elements for Web Design’ is closed to new replies.