BuddyDev

Search

[Resolved] Setting document in new window

  • Participant
    Level: Initiated
    Posts: 9
    David Pell on #12845

    Hi there:
    Since upgrading to v 1.3.3 I can now open a doc as a link.
    However I would like the link to open in a new window (target=”_blank”)

    Can anyone provide a solution for this?

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #12846

    Hi David,
    Please copy

    wp-content/plugin/mediapress/templates/mediapress/default/buddypress/activity/views/grid-doc.php to

    YourThem or Child theme/mediapress/default/buddypress/activity/views/grid-doc.php

    and in the line

    
                    <a href="<?php echo esc_url( $url ); ?>" class="mpp-media mpp-activity-media mpp-activity-media-doc <?php echo $class;?>" data-mpp-activity-id="<?php echo $activity_id; ?>" data-mpp-media-id="<?php mpp_media_id(); ?>" >
                        <img src="<?php mpp_media_src( 'thumbnail' ); ?>" class='mpp-attached-media-item' title="<?php echo esc_attr( mpp_get_media_title() ); ?>"/>
                    </a>
    

    add

    
                    <a href="<?php echo esc_url( $url ); ?>" target="_new" class="mpp-media mpp-activity-media mpp-activity-media-doc <?php echo $class;?>" data-mpp-activity-id="<?php echo $activity_id; ?>" data-mpp-media-id="<?php mpp_media_id(); ?>" >
                        <img src="<?php mpp_media_src( 'thumbnail' ); ?>" class='mpp-attached-media-item' title="<?php echo esc_attr( mpp_get_media_title() ); ?>"/>
                    </a>
    

    We are adding the target attribute.

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    David Pell on #12847

    Hi Brajesh:

    Thanks for getting back to me..

    Will this be clobbered if we update the plugin?
    Or are you saying this will be implemented in the next release so we shouldn’t worry?

    Thx

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #12848

    Hi David,
    I can certainly add an option for the same.

    Also, if you keep a file in your themes directory, It will never be overwritten in plugin update.

    Current method is suitable if you want the feature right now.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    David Pell on #12853

    Thanks that fixed it!

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #12875

    You are welcome!

The topic ‘ [Resolved] Setting document in new window’ is closed to new replies.

This topic is: resolved