Link Custom Field - Value only inside html

  • Posts: 86
  • Thank you received: 11
11 years 2 months ago #155045

-- url of the page with the problem -- : 192.185.143.110/~goodlook/store/product/1-bathmate
-- HikaShop version -- : Essential 2.3.0
-- Joomla version -- : 3.3

I am wanting my "Link" custom field to display like:

<span id="hikashop_product_custom_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_name">
					<a href="<?php echo $value; ?>" class="readon">
                      <?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
                  </a>
				</span>

Unfortunately that displays only the root url. If I do:
<span id="hikashop_product_custom_name_<?php echo $oneExtraField->field_id;?>" class="hikashop_product_custom_name">
					<a href="<?php echo $this->fieldsClass->show($oneExtraField,$value); ?>" class="readon">
                      <?php echo $this->fieldsClass->getFieldName($oneExtraField);?>
                  </a>
				</span>
Then it renders as:
<span id="hikashop_product_custom_name_17" class="hikashop_product_custom_name">
					<a href="/~goodlook/&lt;a href=" http:="" goodlookingloser.com="" forums="" bathmate="" "="">http://goodlookingloser.com/forums/bathmate/</a>" class="readon"&gt;
                      <label for="forum">Forum</label>                  
				</span>

So the <?php echo $this->fieldsClass->show($oneExtraField,$value); ?> renders the extra HTML, where I want ONLY the value to be rendered in that spot.

Any ideas - sorry I'm not PHP expert.

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

  • Posts: 84149
  • Thank you received: 13652
  • MODERATOR
11 years 2 months ago #155100

I would have recommended to use <?php echo $value; ?> like you tried in your first code snippet.
What do you mean by that it only displays the root URL ?
The value of the field will contain exactly what you have stored in the field, so I don't see why it wouldn't be ok ?

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

  • Posts: 86
  • Thank you received: 11
11 years 2 months ago #155170

Ok, I set it as you said and now it works perfectly. I don't know what the heck I did wrong the first time.... I must have had my syntax wrong the first time I tried it.....

Thank you!

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

Time to create page: 0.056 seconds
Powered by Kunena Forum