- Posts: 86
- Thank you received: 11
Link Custom Field - Value only inside html
12 years 4 months ago #155045
by simplecms
Link Custom Field - Value only inside html was created by simplecms
-- 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:
Unfortunately that displays only the root url. If I do:
Then it renders as:
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.
-- HikaShop version -- : Essential 2.3.0
-- Joomla version -- : 3.3
I am wanting my "Link" custom field to display like:
Code:
<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:
Code:
<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>
Code:
<span id="hikashop_product_custom_name_17" class="hikashop_product_custom_name">
<a href="/~goodlook/<a href=" http:="" goodlookingloser.com="" forums="" bathmate="" "="">http://goodlookingloser.com/forums/bathmate/</a>" class="readon">
<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.
12 years 4 months ago #155100
by nicolas
Replied by nicolas on topic Link Custom Field - Value only inside html
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 ?
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.
12 years 4 months ago #155170
by simplecms
Replied by simplecms on topic Link Custom Field - Value only inside html
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!
Thank you!
Please Log in or Create an account to join the conversation.
Time to create page: 0.156 seconds