Is there a way to enable Profile image hover in 2.0

John Love November 30, 2015

In 1.4.x and in a 2.x beta version, when I displayed a profile image in my template, hovering over the image would pop-up the hover profile, but in 2.0, this seems to be disabled. I spent a little time trying to debug it today, but really got nowhere.  Is there a way to enable the profile hover feature?

Thanks,

John

 

P.S. I like the dynamic load feature.  It really helps with page loading.

6 answers

0 votes
Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 2, 2015

Hi John,

I'm not really sure about this. First on DynamicLoad. I have a simple template like this:

#set($pqUser = $userAccessor.getUserByName("fgrund"))
#logoForUserIfExists("fgrund")

Even if I set the DynamicLoad feature on the macro, this works perfectly fine: http://g.recordit.co/EOknGUwWPa.gif

Does this not work for you? Please let me know.

Felix (Scandio)

 

John Love December 3, 2015

Thanks Felix. I will do a bit more looking at this later today. One question I have is what, if any, query is invoking the template? In your example you are hard-coding your username, but in my case the username is being returned by a query of the Confluence database. I wonder if that is the difference. Also, did you see my question above regarding documentation of the parms that you provided? I can find them reference in the documentation link for 2.0. Thanks for all of your help!

Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 3, 2015

1.) reg. hard-coded username: this wouldn't make a difference. You can access your query result from the $result variable. So if the target user is the first row in the result and the column is called "username", you'll get it with $result.get(0).username. So sure that hard-coded works fine for you and it doesn't when taken from the query result? 2.) Do you mean your question "Is this documented somewhere?" -- well, Velocity helpers like #logoForUserIfExists("%username%") come from the Confluence core. They are globally available in Velocity templates (so also in PQ templates) but they aren't really documented anywhere. So basically you'll have to look in the Confluence source code. Or ask me ;)

John Love December 3, 2015

1) I'm not having any issue getting the username from my query or displaying it. I just lose the hover ability when I turn on "Dynamic Load". That was why I asked about the query vs. hard-coding as the "Dynamic Load" seems to be creating a timing issue for me. Of course, I haven't done any other browser testing yet to see if it's specific to Chrome. I'll try IE and Firefox later and Safari when I get home and can use my Macbook. 2) Thanks! I thought maybe that was the case. If I get stuck with something, I will ask. You are always fast with your responses.

Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 4, 2015

1.) really strange - I'm using Mac and Chrome too and that works fine for me with dynamic load. Does it not work either for you with a dummy query "SELECT 1" and a template with the code above with a hard-coded username? Or are you sure it's only with usernames from queries? 2.) "You are always fast with your responses." - glad to hear, thanks! ;)

John Love December 4, 2015

I will try this later today and get back to you. Thank you!

John Love December 4, 2015

Felix, Your example works just fine, so it is my query that is throwing off the timing. I certainly don't consider this a bug. I have plenty of other places where I can use dynamic loading that are not dependent on this kind of timing. If this was super important to me, I would spend some time to see if I could make my query more efficient, but for the situations where I am displaying the logos and name links, page load speed is not really noticeably enhanced by the dynamic load, so I think I will let this go for the time being. Again, thank you for all your help. This has helped me get a much better understanding of PocketQuery and I already thought of it as an awesome product!

Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 6, 2015

Great - thanks John! Let me know if you need more help.

0 votes
John Love December 1, 2015

Oh my goodness!  I cannot believe I wasted your time.  My comment above about timing made me think....Could it be the Dynamic Load Option?  I thought I had tested with and without, but I guess I was so excited about the feature, I just added it and forgot about it.  That was what was causing my issue.  

 

It's still a very valuable feature, but it cannot be used if the query needs to be completed before the page is loaded. 

0 votes
John Love December 1, 2015

I did a little more digging and it looks like  'data-user-hover-bound="true"' is not getting added to the link and no addClass is performed to add the userlink-#.  There appears to be js present to do this, but maybe it's the way in which the loading has changed that the timing of the link creation is off. That's a real stretch of my limited knowledge. but that is how it appears.  

Before 2.0

before.jpg

2.0

after.jpg

 

0 votes
John Love December 1, 2015

Felix,

Not exactly what I was looking for.  Prior to 2.0, a hover over my profile picture gave the results below.  I am showing the results with and without the Communardo User Profile Plugin enabled.  I tried this... #logoForUserIfExists("%username%") and the hover only shows the user name.

Profile.png

Profile2.png

0 votes
John Love December 1, 2015

I am going to try this later today if I have time.  Is this documented somewhere?  I cannot find it in the Documentation link within PocketQuery.  Thanks!

0 votes
Felix Grund (Scandio)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 30, 2015

Hi John!

I'm glad you like dynamic load - this is the first feedback we got so far on version 2.0. So thanks wink

You should easily be able to achieve this in your template. Try this:

#logoForUserIfExists("%username%")

If you only want the link with the hover feature, you can do this:

#set($pqUser = $userAccessor.getUserByName("%username%"))
#userLink($pqUser)

Let me know if this helps!

Regards, Felix (Scandio)

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events