<script>
jQuery('a.reference<?php print $i ?>').colorbox(
{
opacity:0.25,
html:
"<div><strong>Book Title: </strong><?php if (property_exists($noderef, 'field_references_booktitle')) {print $noderef->title_field['und'][0]['value'];} ?></div>"+
"<div><strong>Author: </strong><?php if (property_exists($noderef, 'field_references_author')) { print $noderef->field_references_author['und'][0]['value']; }?></div>"+
"<div><strong>Year Published: </strong><?php if (property_exists($noderef, 'field_references_year_published')) {print date_format(date_create($noderef->field_references_year_published['und'][0]['value']), 'Y'); }?></div>"+
"<div><strong>Publisher: </strong><?php if (property_exists($noderef, 'field_references_publisher')) { print $noderef->field_references_publisher['und'][0]['value']; }?></div>"+
"<div><strong>City Published: </strong><?php if (property_exists($noderef, 'field_references_city_published')) {
?><a href=<?php print $noderef->field_references_city_published['und'][0]['value'];?>>Link</a>
}?></div>",
width: "20%"
});
</script>
The line below is generated when render with the Link text outside of the anchor tag, for that reason it is imposible to click:
<a href=<?php print $noderef->field_references_city_published['und'][0]['value'];?>>Link</a>
field_references_city_published is a text field in the CMS.
I think it is also important to say that if I change $noderef->field_references_city_published['und'][0]['value']
for an URL hardcode works correctly, and also is important to say that the value of field_references_city_published is there when I inspect.
Do you have any idea why that is happened?
Comments
To be more specific
When I inspect the code resulted is this:
Link
=-=
something isn't quite right with your code tags around your original post or the comment.
Hi, why do you think that?
Hi, why do you think that? That code is only a part of the page but it is working, no entirely the
=-=
cod tags around your code in your posts. scroll up ... it's partially unreadable and is trying to act as a link when hovering over it which tends to indicate that a code tag isn't properly placed.
Ok, let me see if with this
Ok, let me see if with this other example is better (I tryed to indent the code to have clearly vision) :