Loading...
 
Skip to main content

Features / Usability


Plugin Button in New Window

posts: 122 United States

Is there any way to use the plugin button and have the link open in a new window? I've been playing around with the standard target="_blank", but nothing seems to work.

Thanks,
Greg

posts: 215

I found a way to do this. I wouldn't say it is pretty. It would be a lot easier if plugin button had an "open in a new window" option.

I added some jquery code to Admin > Look and Feel > Customization tab > Custom javascript:

Copy to clipboard
$('#buttonexternal a').on("click", function(e) {$(this).attr('target', '_blank');});

Then I thought I would be able to add _class="buttonexternal" to the button plugin and have that work, but it didn't.
I was able to get it to work by wrapping the button plugin in a div plugin:

Copy to clipboard
{DIV(id=buttonexternal)} {BUTTON( ... {DIV}


Tom

posts: 3665 United States

The other way to do it, is to simply use the existing button class around a regular external link:

Copy to clipboard
{DIV(class="button")}[http://google.com|Google]{DIV}

Why be a dummy? Get smarty! TikiForSmarties.com
Tiki for Smarties, your source for the best (and only) Tiki books, guides, and tutorials.