BuddyDev

Search

[Resolved] Mediapress open document in new window


  • Participant
    Level: Initiated
    Posts: 4
    Philippe on #27284

    Hi there,

    Thank you very much for your work.

    I’d like the link which is posted in activity stream after having uploaded a new document to open in a new window.
    Right now, when posting an activity with a document attached, the link to the document in the activity stream opens in the same window.

    How do I change that?

    Thanks in advance,
    Philippe


  • Keymaster
    (BuddyDev Team)
    Posts: 13268
    Brajesh Singh on #27288

    Hi Philippe,
    Thank you for using MediaPress.

    There is a solution to it by overriding the template.

    Please copy plugin/mediapress/templates/mediapress/default/buddypress/activity/grid-doc.php

    to your theme(currently active theme/child theme)/mediapress/default/buddypress/activity/grid-doc.php

    Now, Please change this line

    
                <div class="mpp-item-content mpp-activity-item-content mpp-doc-content mpp-activity-doc-content" data-mpp-type="<?php echo $type;?>">
                    <a href="<?php echo esc_url( $url ); ?>" class="mpp-media mpp-activity-media mpp-activity-media-doc <?php echo $class;?>" data-mpp-type="<?php echo $type;?>" 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>
                    <a href="<?php echo esc_url( $url ); ?>" title="<?php echo esc_attr( mpp_get_media_title() ); ?>" class="mpp-activity-item-title mpp-activity-doc-title <?php echo $class;?>" data-mpp-type="<?php echo $type;?>" data-mpp-activity-id="<?php echo $activity_id; ?>" data-mpp-media-id="<?php mpp_media_id(); ?>"><?php mpp_media_title(); ?></a>
                </div>
    
    

    to

    
    
    <div class="mpp-item-content mpp-activity-item-content mpp-doc-content mpp-activity-doc-content" data-mpp-type="<?php echo $type;?>">
    	<a href="<?php echo esc_url( $url ); ?>" target="_blank" class="mpp-media mpp-activity-media mpp-activity-media-doc <?php echo $class;?>" data-mpp-type="<?php echo $type;?>" 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>
    	<a href="<?php echo esc_url( $url ); ?>" target="_blank" title="<?php echo esc_attr( mpp_get_media_title() ); ?>" class="mpp-activity-item-title mpp-activity-doc-title <?php echo $class;?>" data-mpp-type="<?php echo $type;?>" data-mpp-activity-id="<?php echo $activity_id; ?>" data-mpp-media-id="<?php mpp_media_id(); ?>"><?php mpp_media_title(); ?></a>
    </div>
    
    

    What we have done is added

    
    target="_blank"
    

    on the anchor elements. That will do it.

    Regards
    Brajesh


  • Participant
    Level: Initiated
    Posts: 4
    Philippe on #27294

    Thank you very much. That worked.

    In my case the path was:

    currently active theme/child theme)/mediapress/default/buddypress/activity/views/grid-doc.php


  • Keymaster
    (BuddyDev Team)
    Posts: 13268
    Brajesh Singh on #27313

    Thank you.
    I am glad that it worked 🙂

    Regards
    Brajesh

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

This topic is: resolved
Subscribe