[Vtigercrm-developers] tooltips & helptext

Hamono, Chris (DPC) Chris.Hamono at sa.gov.au
Wed Feb 18 00:02:36 GMT 2015


I should add…

The fix below was based in part on work done by Blazej in the yetiforce CRM

Many thanks.

Chris

From: vtigercrm-developers-bounces at lists.vtigercrm.com [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Hamono, Chris (DPC)
Sent: Wednesday, 18 February 2015 9:07 AM
To: vtigercrm-developers at lists.vtigercrm.com
Subject: Re: [Vtigercrm-developers] tooltips & helptext

Thanks Uma

I have worked out what needs to be done.

There is no interface for adding help text to the vtiger_fields table so you will need to use your favourite sql tool to edit that field (phpmyadmin or the commandline client)

Add the help text to the helpinfo column matching your target fieldname.

Go to the template you want to add the help text to. In my case I edited the layouts/vlayout/modules/Vtiger/EditViewBlocks.tpl file which effects all modules

Here is an example before and after code snippet

Before:
<td class="fieldLabel {$WIDTHTYPE}">
   {if $isReferenceField neq "reference"}<label class="muted pull-right marginRight10px">{/if}
  {if $FIELD_MODEL->isMandatory() eq true && $isReferenceField neq "reference"} <span class="redColor">*</span> {/if}

After:
<td class="fieldLabel {$WIDTHTYPE}">
        {if $FIELD_MODEL->get('helpinfo') }
         <a style="margin-left: 5px;margin-top: 2px;" href="#" class=" pull-right" rel="popover" title="{vtranslate('Help', $MODULE)}" data-placement="top" data-trigger="hover" data-content="{vtranslate($FIELD_MODEL->get('helpinfo'), $MODULE)}"><i class="icon-info-sign"></i></a>
         {/if}
         {if $isReferenceField neq "reference"}<label class="muted pull-right marginRight10px">{/if}
         {if $FIELD_MODEL->isMandatory() eq true && $isReferenceField neq "reference"} <span class="redColor">*</span> {/if}


Lastly add the following code to the end of layouts/vlayout/modules/Vtiger/JSResources.tpl

<script>
    jQuery().ready(function(){
        jQuery('[rel=popover]').popover();
    });
</script>


This is what you should get when you have finished..

[cid:image001.png at 01D04B65.B1D6F860]


Chris

From: vtigercrm-developers-bounces at lists.vtigercrm.com<mailto:vtigercrm-developers-bounces at lists.vtigercrm.com> [mailto:vtigercrm-developers-bounces at lists.vtigercrm.com] On Behalf Of Uma S
Sent: Tuesday, 17 February 2015 4:56 PM
To: vtigercrm-developers at lists.vtigercrm.com<mailto:vtigercrm-developers at lists.vtigercrm.com>
Subject: Re: [Vtigercrm-developers] tooltips & helptext

Hi,

Hope so you can feed in data to help info field of vtiger_field table and make us of this while creation of field model, which in turn can be used with tooltips.

On Tue, Feb 17, 2015 at 4:26 AM, Hamono, Chris (DPC) <Chris.Hamono at sa.gov.au<mailto:Chris.Hamono at sa.gov.au>> wrote:

I have searched through the source code and there are a number of references to tooltips

The vtiger_fields table contains the helpinfo field which I assume is for tooltips or help info. But the glue between that field and displaying it in the templates seems to be missing. There is also no way to edit that field via the GUI.

Also bootstrap tootip.js is loaded on every page load yet it appears unused.

As our client requires us to provide help info for each field how can we complete the linking of the helpinfo field to the tooltip or a popup help div?

Yes I am aware of the vtigerexperts module in development but it seems to me a great deal of work has already been expended creating the framework, I see no need to reinvent the wheel.

Any information or help is appreciated.

Chris


_______________________________________________
http://www.vtiger.com/



--
With
Best Regards
Uma.S
Vtiger Team
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150218/1375ad98/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 17653 bytes
Desc: image001.png
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20150218/1375ad98/attachment-0001.png>


More information about the vtigercrm-developers mailing list