• Resolved KCMiller401

    (@kcmiller401)


    Wow. I am learning so much just following your help for everyone else on this forum. Thank you. Using your advice I have now built 3 different types of buttons, but can only seem to get them to print nothing or the whole page when I would like to exclude the header, particularly the navigation bar. Interestingly, in PoM options, if I leave the the Default Target Attribute empty or set to anything except body, they all print blank!
    Using Firebug I have determined that the potion I would like to print is: <div class=”gdlr-item gdlr-main-content”>. Looking at it the other way, the portion I would like not to print is: <div class=”gdlr-header-inner”>.
    Would you help me figure out what I am doing wrong on one or all of these my attempts?

    Thanks so much.


    http://www.oriresults.com/associationcx/

    https://ww.wp.xz.cn/plugins/print-o-matic/

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Baden

    (@baden03)

    yup! super easy.
    the target you are using in this example:

    <button id="my_print_button" class="printomatictext" data-print_target="#gdlr-item gdlr-main-content">Print Page</button>

    is an element with an ID of gdlr-item gdlr-main-content but in actuality you want to target an element with a class by the name gdlr-main-content.

    all you have to do is, switch your target!
    BAD:

    "#gdlr-item gdlr-main-content

    GOOD:

    .gdlr-main-content

    see what we did there? in CSS #something is an ID and .something is a class.
    ah-ha moment!

    Thread Starter KCMiller401

    (@kcmiller401)

    Thanks so much. Unfortunately, that gives me a frowny face with a 404 error page on Firefox and a blank page (except for the date) on Chrome! Any other thoughts on what I have wrong? (I altered all 3 buttons with the . ).

    Plugin Author Baden

    (@baden03)

    how exactly are you creating the HTML coded second button?

    Thread Starter KCMiller401

    (@kcmiller401)

    Really, just a conglomeration of what I am seeing you recommend in the forum and my dangerously little experience, with a large dose of trial and error! Right now it is:
    <button id=”my_print_button” class=”printomatictext” data-print_target=”.gdlr-item gdlr-main-content”>Print Page</button>

    Since I do not use the button id=”my_print_button” anywhere else, I am guessing it is flawed.

    Does that tell you anything?

    I am happy to start from scratch, any suggestions?

    Plugin Author Baden

    (@baden03)

    ok.
    Let’s break it down:
    <button id="my_print_button" class="printomatictext"
    create a button with an ID of my_print_button and a class of printomatictext
    the ID is fine, and you need the printomatictext class to trigger the print.

    data-print_target=".gdlr-item gdlr-main-content"
    here is where you are defining your target, but in this case, there are two targets and this is confusing as we are trying to target:
    an element with a class of gdlr-item
    and an element with a tag of gdlr-main-content

    you just need to target .gdlr-main-content

    so all together try this:

    <button id="my_print_button" class="printomatictext" data-print_target=".gdlr-main-content">Print Page</button>

    if it that does NOT work, let us know (and keep it up) so we can see what else the problem might be.

    Thread Starter KCMiller401

    (@kcmiller401)

    Thank you. Closer. Now the part I want printed flashes by before becoming the 404 page!

    Other thoughts?

    Plugin Author Baden

    (@baden03)

    oh wow, interesting! What is the setting under:
    Dashboard > Settings > Print-O-Matic > Close After Print?
    Update:
    the problem is most likely related to including the external print trigger inside the print target. is there any way you can place the print trigger(s) outside of the print target?

    Thread Starter KCMiller401

    (@kcmiller401)

    The Close After Print box was checked, but it acts the same unchecked.

    I am afraid you are beyond me now. I do not even fully understand the question! I understand that the print target is what I want printed:.gdlr-main-content and that the trigger is the button that I have designed with the CSS and has the class printomatictext, but I have no idea how to move them in or out of each other.

    Would it make sense to try this with the older hack that does not use the printstyle value “external”? (I was working from your explanation on http://spacedonkey.de/2400/print-o-matic-external-buttons/)

    In my first attempt I tried to use the short code excluding the unwanted header instead of only including the wanted part; it showed up but did not work for awhile, but is there anything there we could work with?
    [print-me printicon=”false”]
    [print-me target=”body”]
    [print-me do_not_print=”.gdlr-header-inner”]
    [print-me title=”Print Form”]

    Thanks again so much for all this help.

    Plugin Author Baden

    (@baden03)

    ok, let’s back waaaay up.
    1. remove all print-o-matic triggers / buttons, shortcodes, etc…
    2. just use this (for now):

    [print-me target=".gdlr-main-content"/]

    does that work at all?

    Thread Starter KCMiller401

    (@kcmiller401)

    YAY! I had to delete all other button attempts and permit the printer icon, but the printer icon now shows and prints the correct material. 🙂

    Now, any ideas on how to use my CSS to make it a large button?

    Eternally grateful.

    Plugin Author Baden

    (@baden03)

    looking at the source code, it seems the code tags were copied over, be sure if you paste code into the editor, be in TEXT mode (not visual mode) of the editor.

    Now you need to replace the print-me shortcode with the following:

    <button id="my_print_button" class="printomatic" data-print_target="#gdlr-main-content">Print Button Text</button>
    [print-me id="my_print_button" printstyle="external"/]

    let us know how that goes!

    Thread Starter KCMiller401

    (@kcmiller401)

    THANK YOU!!!!

    I changed the # to . in the target and class=”printomatic” to class=”printomatictext” (see how much you have taught me) in the above and it works.

    I am most appreciative,
    KCMiller

    Plugin Author Baden

    (@baden03)

    glad you got it working!
    If you are happy with the plugin or it’s support, consider leaving a review.
    Issue marked as resolved.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Excluding the navigation bar’ is closed to new replies.