SOLVED: Tool tip to show relevant values from another element?...

Status
Not open for further replies.

puzzled

Member
Hi I have a list of icons in a table. Each icon has a 'name' element and a 'image' element as well as the usual ID etc.

I have got the icons to display in a nice list and activated the tool tips. I have managed to get the "name" element to appear in the tool tip using this in the Tip Text field:
{fabrik view=element list=87 rowid=1 element=tablename___Name}
However, this obviously only shows the first row so all my images have the same tool tip. How can I get it to display the Name relevant to the Image?
I hope this makes sense!
Thanks
 
I probably should mention that I am doing this within a databasejoin element. The images are brought in using this code in the 'Data' > 'Or Concact Label' field:
'<img src="http://myweburl.com/', {thistable}.elementname,'">'

Is there a way of writing the {fabrik...} code to get it to show my 'Name' element in the tool tip where the rowid is the same as the 'image' element I am hovering over?!?!?!

Sorry but I have no idea when it comes to writing code for this. Please can someone help?
Thanks
 
Ok - so I have tried another way to get the tool tips on each of my icons to display the 'icons name' and I have ALMOST got it to work. I just need someone to check the code I have used.

I already had this code in my databasejoin element in the Data > Or Contact Label section (thanks to some kind sole on this forum)
'<img src="http://mysitename.com/', {thistable}.myicon_element,'">'

So based on the above that worked and displayed my icons fine I have added a class of fabrikTip and a title which needs to be the value from myname_element.
'<img src="http://mysitename.com/', {thistable}.myicon_element,'" class="fabrikTip" title="',{thistable}.myName_element,'">'

As mentioned it pretty much works this is the html output of the bit that works:
<li><img src="http://mysitename.com/images/myicon4.gif" class="fabrikTip" title=""></li>

but I am getting weird results where it is merging together the last record of the databasejoin element and the beginning of my next element within the html as follows:
<li><img src="http://mysitename.com/images/mylasticon.gif" class="fabrikTip" title="" next element carries on here bla bla and seems to get plonked inside this list rather than one of its own</li>

So, in short I think I must have a comma in the wrong place or something!! I can't write code so have guessed at what it should be based on what I had.

Pleeeeease can someone help!
 
Also when I use the code as described above it is only showing the first 8 items in my list and the rest don't display at all.
 
hi if you fill in your site details here http://fabrikar.com/you/my-sites/ we'll take a look. My hunch is that it might be something to do with the specific content that is being injected into the tip text, but we'd need to take a look at the page itself to confirm that one.

Cheers
Rob
 
Rather than {thistable}.myicon_element, try just using a regular placeholder like {yourtable___myicon_element}, i.e. the full element name.

-- hugh
 
You'll need to give us an admin login as well as the site URL, so we can look at the configuration on the backend.

-- hugh
 
Hi Thanks Hugh...
If I put what you said in the Or Concat Label field I get massive error "getData:You have an error in your SQL syntax......."
If I try it in the tool tip field it just shows the element name with curly brackets as the tool tip rather than data from that element and it is the same for each image.

I will sort out admin access for you in a moment. Thanks :)
 
I meant in the tooltip. The only places where {thistable} is used is when it is SQL code, like the "concat label", or a "where" filter, etc. On the whole, when you need an element's value, you use the {tablename___elementname} placeholder format.

I'm just not sure if we do placeholder parsing in the tooltips. I'll go and have a look at the code.

-- hugh
 
For the tool tip I think it will need some php code in it so that the tool tip shows the right 'Name' for the 'Image' it is hovering over, if you see what I mean? Otherwise it may just show the same value for all the images?
 
hi - I think I've fixed this one.
At least for me the tips show and I couldn't see any truncated tip text:

I used the following for the concat label:
Code:
'<img src="http://www.babycationsasia.com/',
{thistable}.hotelfacilities,'"  class="fabrikTip" title="', {thistable}.Name ,'">'

which is what you previously had. I removed the '{facilitiesnew___Name}' from the tip text option, and set the "show tips in list view" to "no" - which is counter intuitve, but stops us adding in addtional fabrikTips classes when your concat code had already added it.

Finally to test I turned off the system cache plugin (as otherwise you would see the cached version of the page and not the one which represents the current settings)
The page seems to load ok, so I turned the system cache plugin back on.
 
Sorry Rob but this is one of the options I tried earlier and I am getting truncated html output - see screen shot attached.

It does this for me in IE11 and Chrome v34

<li><img src="http://mysite.com/.../image.gif" class="fabrikTip" title="" database_tablename___nextelement="" fabrik_element="" fabrik_list_number_group_number"="">
<span class="divlabel">My text</span>
<span class="divelement"><ul class="fabrikRepeatData"><li><a data-loadmethod="iframe" data-list="list_number_com_fabrik_number" class="fabrik___rowlink fabrik_view" href="/index.php/mylink.html">My text</a></li></ul></span>
</li>

---Edit---
So the images list stops after title="" and my next element starts to display within the same list as this one when it should be separate
 

Attachments

  • Untitled-2.jpg
    Untitled-2.jpg
    20.5 KB · Views: 454
Just to clarify it is not the tip text that is getting truncated it is the "image list" see my previous attachment : )
 
I gave the full url in your mysites bit when I gave you access - let me just check it

---Edit---
Yes I have listed the full url of the page you need as my Site Name :)
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top