I am trying to rewrite the output of node.tpl.php.
I am using field link. I cannot figure out how to get the field to render as a button. I did find that the field is output as an array
I tried this but it just makes the link just a link to the page I am on:
<a class="btn btn-danger btn-lg" href="<?php print render ($content[field_amazon_link][LANGUAGE_NONE][0]['display_url']); ?>">Buy Now</a>
The devel module gives me this info. Keep in mind php is my week area. This is my first time rewriting a node file as I used to have a helper and he has moved on.
field_amazon_link (Array, 1 element)
0 (Array, 5 elements)
url (String, 142 characters ) https://www.amazon.com/gp/product/B00ZGUBN3C/re...
title (String, 83 characters ) https://www.amazon.com/gp/product/B00ZGUBN3C/re...
attributes (Array, 1 element)
html (Boolean) FALSE
display_url (String, 83 characters ) https://www.amazon.com/gp/product/B00ZGUBN3C/re...
And this is from the object devel tool field_amazon_link (Array, 1 element)
und (Array, 1 element)
0 (Array, 5 elements)
url (String, 142 characters ) https://www.amazon.com/gp/product/B00ZGUBN3C/re...
title (String, 83 characters ) https://www.amazon.com/gp/product/B00ZGUBN3C/re...
attributes (Array, 1 element)
html (Boolean) FALSE
display_url (String, 83 characters ) https://www.amazon.com/gp/product/B00ZGUBN3C/re..