WordPress.org

Ready to get started?Download WordPress

Forums

WP Publication Archive
[resolved] Open docs in new window (9 posts)

  1. htdev
    Member
    Posted 1 year ago #

    I noticed that opening docs in a new window was not included in the recent 2.5.3 release. Any ideas when this might be included? Is there a work-around to accomplish this currently? hooks, etc?

    http://wordpress.org/extend/plugins/wp-publication-archive/

  2. Eric Mann
    Member
    Plugin Author

    Posted 1 year ago #

    I noticed that opening docs in a new window was not included in the recent 2.5.3 release.

    Noticed ... where?

    The entire point of the 2.5.X branch was to allow users to click to open publications rather than just clicking to download. How are you using the plugin? Can you provide a link so I can see any issues you might be having?

    The new default behavior as of version 2.5 is to open rather than download publications, so I'm not sure what issue you're facing.

  3. htdev
    Member
    Posted 1 year ago #

    We're running 2.5.3. The site is still in development, I'll have to check with the client before I can post a link.

    We're simply using the shortcode with a category to list certain documents on a page. However, what I see on the page where the docs are listed is this:

    Open | Download

    Clicking the "Open" link opens the document (if it's a PDF) right in that window, in Chrome, Firefox and IE. Clicking "Download", in Firefox and Chrome, will open the document in a new window/tab. IE asks what you want to do with it.

    It's the "Open" link behaviour that we would like to have go to a new window/tab and not leave the underlying page.

  4. Eric Mann
    Member
    Plugin Author

    Posted 1 year ago #

    OK, that is the expected behavior. I cannot predict what browser people are using, so clicking the Open link will stream the document to the browser and defers to the browser for what to do with it.

    I'm adding a hook in version 2.5.5 that will allow you to force the open link to use a new window. Upgrade to version 2.5.5, then add the following to your theme:

    add_filter( 'wp_pubarch_open_in_blank', '__return_true' );

  5. htdev
    Member
    Posted 1 year ago #

    OK, I'll pass that back on. Thanks.

    Something else that might be useful is to add some span and/or classes around the Open and Download. That way we can better target CSS to each link if we need to.

    If there had been something there to target, I may have just hidden the "Open" link altogether.

    Thanks for the prompt reply Eric. It's been a good plugin for us.

  6. web1
    Member
    Posted 1 year ago #

    Hi - Love this module

    Just on opening new page
    Upgrade to version 2.5.5, then add the following to your theme:

    add_filter( 'wp_pubarch_open_in_blank', '__return_true' );

    sorry to be a dummy - what file is this added to and where?

    thanks
    Peter

  7. htdev
    Member
    Posted 1 year ago #

    add that to your theme's functions.php file

  8. web1
    Member
    Posted 1 year ago #

    cool

    thanks so much

    Peter

  9. Eric Mann
    Member
    Plugin Author

    Posted 1 year ago #

    @web1 And next time, please open a new thread. Once these are marked as "resolved" I don't always see them to drop back by to help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic