Keyword

[SOLVED] Replace extra fields name with an image * SOLVED *

More
9 years 11 months ago - 9 years 11 months ago #131073 by Sanjiv Khullar
Replied by Sanjiv Khullar on topic Re:Replace extra fields name with an image
Krikor

I can see why it is not working - the label is replaced by the image - the value is changed to display:none - the image needs to referenced to the value to work

This is the last item - so I hope you can help


- it is the image which does not link to the value

enclosed is my code

<div class="k2leftcolumn">


<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
<!-- Item extra fields -->
<div class="itemExtraFields">
<h3><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h3>
<ul>
<?php foreach ($this->item->extra_fields as $key=>$extraField): ?>
<?php if($extraField->value != ''): ?>
<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>">
<?php if($extraField->type == 'header'): ?>
<h4 class="itemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
<?php else: ?>
<span class="itemExtraFieldsLabel<?php echo $extraField->alias; ?>"><?php echo $extraField->name; ?>:</span>
<span class="itemExtraFieldsValue<?php echo $extraField->alias; ?>"><?php echo $extraField->value; ?></span>
<?php endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<div class="clr"></div>
</div>
<?php endif; ?>


</div>
<div style="clear:both;"></div>

is there any additional code i can add to create a link with the image and url

Thank you

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #131074 by Sanjiv Khullar
Replied by Sanjiv Khullar on topic Re:Replace extra fields name with an image
Krikor

Can you please explain what you mean by "You need to change the way the fields are set up. "
What changes are needed?

Thank you

Sanjiv

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #131075 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re:Replace extra fields name with an image
You need the <a> tag to enclose all other elements so the links can actually work.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #131076 by Sanjiv Khullar
Replied by Sanjiv Khullar on topic Re:Replace extra fields name with an image
Krikor

the links do work - I have removed the display none for the values

The labels are being replaced by an image which are referencing the value

Can you please let me know the code to fix the issue so the images are linkable

Thank you

Sanjiv

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #131077 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re:Replace extra fields name with an image
I told you this is an HTML error. You need to enclose all the linked item inside an <a> tag.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
9 years 11 months ago #131078 by Sanjiv Khullar
Replied by Sanjiv Khullar on topic Re:Replace extra fields name with an image
what linked items ?

I have tried multiple places in the item.php file to add the <a> tag and nothing works

<?php else: ?>
<a>
<span class="itemExtraFieldsLabel<?php echo $extraField->alias; ?>"><?php echo $extraField->name; ?>:</span>
</a>
<span class="itemExtraFieldsValue<?php echo $extraField->alias; ?>"><?php echo $extraField->value; ?></span>

<?php endif; ?>

Is it another file ?
what exact code should I be looking for ?

Thank you

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #131079 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re:Replace extra fields name with an image
www.w3schools.com/tags/tag_a.asp

This is how links work in HTML.
You can either use one extrafield as the link and echo its value as an href or use the link I posted on github.
If you are not familiar with HTML coding you should consider addressing this issue to a developer.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum