[Skip to main content](#vessel-content)

#   adding more info click to custom fields?

##

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 4 months ago [\#20065](#20065) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20065 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

Try to add the doextra = false; line in the }else if(obj.id=='user_choice_activate_plan_iq_phone'){ and else if(obj.id=='user_choice_activate_phone'){ blocks.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile")
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 4 months ago [\#20282](#20282) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20282 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

I have a similar requirement.
Could the following parameters be added to custom field definitions:

Help Text
Help Link
Help Image

How these are used could be left to the customised views.
This will allow text / link / image changes to be made through the admin screens and not in the code.

As a further refinement the default shipped views could be enhanced as follows:

> (1) Help text - entered, link - null, image - null
> Hover over label displays text in popup.
>
> \* (2) Help text - entered, link - null, image - entered
> Hover over (or click) image displays text in popup.
>
> (3) Help text - null, link - entered, image - entered
> Show image after field.
> Click image opens help page (further options needed?).
>
> (4) Help text - entered, link - entered, image - entered
> Show image after field.
> Click image opens help page (further options needed?).
> Hover over image shops the text.
>
> (5) Help text - entered, link - entered, image - null
> Show text as a link after field.
> Click text opens help page (further options needed?).

* this is the one I have an immediate requirement for.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 4 months ago [\#20297](#20297) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20297 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

Maybe you could use the new "custom text" type of custom fields to add some text (and/or HTML) on the forms ? It won't be displayed in a popup bu directly in the form but that might be even for what you're trying to do ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile")
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 4 months ago -  15 years 4 months ago [\#20329](#20329) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20329 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

I will have to look at custom fields later - maybe put the text there as a Javascript array or a PHP array and invoke it using eval().

For now I have implemented it using the following PHP functionSee later post for latest version: Code:

static function showFieldHelp($fieldname, $label=null, $content=null, $helpIcon='&lt;img src="images/mysite/help-icon2-15.png" alt="help"/&gt;') { switch ($fieldname) { case 'TO BE REPLACED1': $helpText = 'Help under construction.'; break; case 'TO BE REPLACED2': $helpText = 'Help under construction.'; break; case 'TO BE REPLACED3': $helpText = 'Help under construction.'; break; default: return $content; } if (empty($content)) { if (empty($helpIcon)) return null; $content = $helpIcon; } $code = ' &lt;script type="text/javascript"&gt; window.addEvent(\'domready\', function(){ $$(\'.tooltip_'.$fieldname.'\').each(function(element,index) { var content = element.get(\'title\').split(\'::\'); element.store(\'tip:title\', content[0]); element.store(\'tip:text\', content[1]); }); var tooltip_'.$fieldname.' = new Tips($$(\'.tooltip_'.$fieldname.'\'), { className: \'mysite-tooltips\', showDelay: 0, hideDelay: 100, fixed: true, windowPadding: {x:10,y:10} });}); &lt;/script&gt;'; return '&lt;span class="hikashop-help-icon tooltip_'.$fieldname.'" title="'.htmlspecialchars($label).' :: '.htmlspecialchars($helpText).'"&gt;'.$content.'&lt;span&gt;' . $code ; }

This then gets called like this (e.g. in the address form.php): Code:

echo '&lt;td class="key"&gt;'; // Hover over label help echo comMyHikashopHelper::showFieldHelp('L_'.$fieldName, $oneExtraField-&gt;field_realname, $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField)); echo '&lt;/td&gt;'; ... etc ... echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$this-&gt;address-&gt;$fieldName,'data[address]['.$fieldName.']'); // Hover over help icon echo comMyHikashopHelper::showFieldHelp($fieldName, $oneExtraField-&gt;field_realname);

Next refinement would be to put the help text *($helpText)* into a language file instead of in the php code.
The ideal solution would be if the text and icon image came from the *$oneExtraField* object.

Last edit: 15 years 4 months ago by [brainforge](/forum/user/423-brainforge "View brainforge's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 4 months ago [\#20343](#20343) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20343 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

You should be able to do that by adding new columns in the hikashop_field table and then editing the file form of the view field to add some input fields for them.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile")
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 4 months ago [\#20370](#20370) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20370 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

Thanks, will look in more detail later.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile")
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 4 months ago [\#20374](#20374) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20374 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

Works great thanks.
Would it be useful to add into Hikashop core?
Can be left to custom views to decide how they are used.
Changes attached.

####  *This attachment is hidden for guests.
Please log in or register to see it.*

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile")
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 4 months ago -  15 years 4 months ago [\#20375](#20375) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20375 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

Simplified my earlier showFieldHelp() routine, now looks like this.
Satisifies my current requirements, may need more refinement later on. Code:

static function showFieldHelp($fieldname, $field, $content=null, $hideicon=false) { if (empty($field-&gt;field_help_text) &amp;&amp; empty($field-&gt;field_help_icon) &amp;&amp; empty($field-&gt;field_help_link)) return $content; if ($hideicon) $helpIcon = null; else if (empty($field-&gt;field_help_icon)) $helpIcon='&lt;img src="images/mysite/help-icon2-15.png" alt="help"/&gt;'; else $helpIcon='&lt;img src="' . $field-&gt;field_help_icon . '" alt="help"/&gt;'; if (empty($content)) { if (empty($helpIcon) &#124;&#124; $hideicon) { if (empty($field-&gt;field_help_link)) return null; $content = $field-&gt;field_help_link; } else $content = $helpIcon; } $code = ' &lt;script type="text/javascript"&gt; window.addEvent(\'domready\', function(){ $$(\'.tooltip_'.$fieldname.'\').each(function(element,index) { var content = element.get(\'title\').split(\'::\'); element.store(\'tip:title\', content[0]); element.store(\'tip:text\', content[1]); }); var tooltip_'.$fieldname.' = new Tips($$(\'.tooltip_'.$fieldname.'\'), { className: \'mysite-tooltips\', showDelay: 0, hideDelay: 100, fixed: true, windowPadding: {x:10,y:10} });}); &lt;/script&gt;'; return '&lt;span class="hikashop-help-icon tooltip_'.$fieldname.'" title="'.htmlspecialchars($field-&gt;field_realname).' :: '.htmlspecialchars($field-&gt;field_help_text).'"&gt;'.$content.'&lt;span&gt;' . $code ; }

This then gets called like this (e.g. in the address form.php): Code:

echo '&lt;td class="key"&gt;'; // Hover over label help echo comMyHikashopHelper::showFieldHelp('L_'.$fieldName, $oneExtraField, $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField), true); echo '&lt;/td&gt;'; ... etc ... echo $this-&gt;fieldsClass-&gt;display($oneExtraField,$this-&gt;address-&gt;$fieldName,'data[address]['.$fieldName.']'); // Hover over help icon echo comMyHikashopHelper::showFieldHelp($fieldName, $oneExtraField);

[strike]Next refinement would be to put the help text *($helpText)* into a language file instead of in the php code.
The ideal solution would be if the text and icon image came from the *$oneExtraField* object.[/strike]

Last edit: 15 years 4 months ago by [brainforge](/forum/user/423-brainforge "View brainforge's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 4 months ago [\#20404](#20404) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20404 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

Sounds great. We'll look at adding that for next release.
We will probably want to include the showFieldHelp function in the file administrator/components/com_hikashop/classes/field.php
so that getFieldName and display can directly use it without having to change all the views.

For the translation, it should also be able to use the trans function of that same file in order to translated the text via the translation files.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[brainforge](/forum/user/423-brainforge "View brainforge's Profile")**
- [![brainforge's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar423.jpg)](/forum/user/423-brainforge "View brainforge's Profile")
- [ Offline](/forum/user/423-brainforge)

Less More

- Posts: 298
- Thank you received: 5
-
-
-
- [](https://brainforge.co.uk)
-

15 years 4 months ago [\#20423](#20423) by [brainforge](/forum/user/423-brainforge "View brainforge's Profile")  Replied by *[brainforge](/forum/user/423-brainforge "View brainforge's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20423 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

Good to hear you will be looking into adding that into the core code.

It has since occurred to me that the ability to add custom fields to the field table itself (probably a confusing concept :woohoo: ) could be quite a powerful feature - up to view coders to decide what they might want to do with any such fields.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86561
- Thank you received: 14307
-
-

15 years 4 months ago [\#20445](#20445) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: adding more info click to custom fields?](/forum/4-how-to/18793-adding-more-info-click-to-custom-fields?start=60#20445 "i would like to add a link right after to the field of the order custom fields. check out the image.  the idea is to have a link that will be a lightbox window with more information about what we are asking for in the field.  should be a core feature :)  anyway for now i just need to make it happen though, any ideas of the easiest way to implement it?")*

That's indeed an interesting idea as well. We'll add that to the todo list.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4NzkzLWFkZGluZy1tb3JlLWluZm8tY2xpY2stdG8tY3VzdG9tLWZpZWxkcz9zdGFydD02MCZ0bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.117 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
