Advertisement:

Author Topic: [SOLVED] How do I make certain links open in a new window or pop-up?  (Read 797 times)

mattlok

  • Newbie
  • *
  • Posts: 40
hi Everyone.

Wondering how do I make links open in a new windows or pop-up window.

For example, I have a PDF link generator for each post (from the Print PDF plugin).  How do i make it so that it will open in a new windows.

Or in that same posting page, there is a link called "share" and i want to open in a new pop-up window.

I already have the script in CSS and jQuery to create the pop-up window but the when i look at the code in the item.php i see this:

<li><a href="<?php echo osc_item_send_friend_url(); ?>" rel="nofollow">
            <?php _e('Share', OSCLASSWIZARDS_THEME_FOLDER); ?>
            </a></li>

 
« Last Edit: March 22, 2016, 08:51:53 am by mattlok »

teseo

  • Hero Member
  • *****
  • Posts: 6169

mattlok

  • Newbie
  • *
  • Posts: 40
Re: How do I make certain links open in a new window or pop-up?
« Reply #2 on: March 22, 2016, 05:53:41 am »
Hi Teseo,

sorry that was definitely an obvious one i should have not used that as an example.

so somewhere on my item.php -- i added one of the Osclass plugins for PDF print and all i got was this code to work with.

<?php show_printpdf(); ?> (this code generates a PDF link that opens in the same browser)

there was no href to work off of, and i don't think i can do this ---- <a href="<?php show_printpdf(); ?> target="_blank"</a>

mattlok

  • Newbie
  • *
  • Posts: 40
Re: [SOLVED] How do I make certain links open in a new window or pop-up?
« Reply #3 on: March 22, 2016, 08:54:33 am »
Hi Everyone,

If you are trying to make the plugin for the PrintPDF to open in a new browser,

you need to goto the plugin directory and look for the PRINTpdf folder and open index.php ---- and insert this code: target="_blank"

on line 72 (using Brackets as my editor)

echo '<a href="'.osc_base_url().'oc-content/plugins/'.osc_plugin_folder(__FILE__).'/download.php?item='.osc_item_id().'" target="_blank" class="printpdf_link" >'.__('Download PDF', 'printpdf').'</a>';

fosg2000

  • Jr. Member
  • **
  • Posts: 82
thanks, i was looking for this

now i want to make it an icon like share items, to show intead DOWLOAD PDF word

check here :

http://toyenmala.com/for-sale/jewelry-watches/jewelry-watches-in-restauracion_i11

any ideas ?