Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Hi Dave,

    This is already possible in 3.0.2. When you make a field of type URL, simply check “open in a new window” inside Manage Form Fields for that field.

    You can also make it nofollow if you like as well.

    Thread Starter atrixdave

    (@atrixdave)

    Excellent! Thank you and I apologize for the dumb question ??

    Hi

    What if I want the single listing’s page to be open in a new window/tab?
    F.e. after clicking listing title or thumbnail in excerpt?

    Pawe?

    Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Hi Pawel,

    Right now, we don’t have a configuration option for that. The listing detail views will open in the same window. URL fields that you define on the listing can support the new window/same window link setting above.

    Hi

    Thanks for your reply. Is there any way to modify one of the files to get the same result? Add target=”_blank” somewhere?

    Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    Yes, I’m sure there is. I’ll have to ask my developer specifically where, but he’s unavailable for a few days. I’ll let you know when I hear back.

    Plugin Author Business Directory Plugin

    (@businessdirectoryplugin)

    OK, he responded more quickly than I thought:

    There are two ways you could gain access to the detailed view of a listing: by clicking the link on the “Business Name” field or by clicking the “View” button.
    Changing the behavior for the link can be done by modifying function get_field_html_value() inside form-fields.php (around line 71) and changing

    $value = sprintf( '<a href="%s">%s</a>', get_permalink( $post_id ), get_the_title( $post_id ) );

    to

    $value = sprintf( '<a href="%s" target="_blank">%s</a>', get_permalink( $post_id ), get_the_title( $post_id ) );

    Notice the target=”_blank” addition.

    As for the “View” button refer to the file templates/parts/listing-buttons.tpl.php around line 15. Change

    onclick="window.location.href = '<?php the_permalink(); ?>' "

    to

    onclick="window.open('<?php the_permalink(); ?>', '_blank');"

    That should do the trick.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Open Website Links In New Window’ is closed to new replies.