-1

I am using custom style on my rpg type forum and I wanted to add simple button using custom fields that will redirect you to character sheet (which is a thread). This button can be viewed in meberlist.php?mode=viewprofile which is simply preview of users profile. Now the problem is - when I hover over the button browser shows the correct link. When I open in new tab, browser redirects me to correct page on the new tab. But when I left click it doesnt open new tab - instead it redirects me to another memberlist page which is main group of the user.

Here is the code im using in memberlist_view.html

<!-- IF custom_fields.PROFILE_FIELD_NAME eq "Karta postaci" -->
<dd><a href="{custom_fields.PROFILE_FIELD_VALUE}" target="_blank"><button class="button">KARTA POSTACI</button></a>
</dd>
<!-- ENDIF -->

Any idea how it does that and how to prevent this?

Gorzalt
  • 1
  • 2

1 Answers1

0

You don't have to use a button. Button is a tool for a form. You only have to custom design of your link.

Add a class to your "a" tag.

<dl>
<!-- IF custom_fields.PROFILE_FIELD_NAME eq "Karta postaci" -->
<dd><a class="foo" href="{custom_fields.PROFILE_FIELD_VALUE}" target="_blank">KARTA POSTACI</a>
</dd>
<!-- ENDIF -->
</dl>

In CSS, custom your tag so to give it a button style.

a.foo{
  border:medium #999 outset;
  padding:10px;
  background-color: #999;
}
a.foo:hover, a.foo:focus{
  border-style: inset;
}

Here is an example : https://jsfiddle.net/mmck7fnk/

Alexandre Tranchant
  • 4,426
  • 4
  • 43
  • 70