HOWTO: Pop-Ups on User Icons in Posts and Comments

Dec 19, 2007 09:41

UPDATE (2008/04/25): The print_comment() function in this post has been updated to allow the use of the "expand comments" link, which was previously unavailable in custom layers.

In response to this post by lollobrigida, these functions will add pop-ups or "tooltips" to entries and comments when hovering over user icons. Now more standards compliant! This ( Read more... )

comments, !tutorial, entries:user icons, $acct level:paid or perm

Leave a comment

Comments 15

Hmmmm.... onlysayinghello December 19 2007, 21:31:56 UTC
Okay the first part compiles just fine, but when I put in both? it does return this error on me :

S2 Compiler Output at Wed Dec 19 21:37:29 2007
Error compiling layer:

Compile error: line 708, column 38: Unknown function have_collapsed(Comment)
S2::NodeTerm, S2/NodeTerm.pm, 196
S2::NodeTerm, S2/NodeTerm.pm, 66
S2::NodeLogAndExpr, S2/NodeLogAndExpr.pm, 47
S2::NodeExpr, S2/NodeExpr.pm, 46
S2::NodeIfStmt, S2/NodeIfStmt.pm, 79
S2::NodeStmtBlock, S2/NodeStmtBlock.pm, 101
S2::NodeIfStmt, S2/NodeIfStmt.pm, 92
S2::NodeStmtBlock, S2/NodeStmtBlock.pm, 101
S2::NodeFunction, S2/NodeFunction.pm, 230
S2::Checker, S2/Checker.pm, 353
S2::Compiler, S2/Compiler.pm, 34

Context

704: print lang_posted_by_date_and_time($e, false, true, true);
705:
706: var Link expand_link;
707: $expand_link = $e->get_link("expand_comments");
708: if (defined $expand_link and have_collapsed($e)) {
709: """ $*text_expand_link """;
710: }
711:
712: if (size($e.replies) > 0) {

Reply

Re: Hmmmm.... onlysayinghello December 19 2007, 21:40:13 UTC
But! Having the first part work should mean that it should have the name show up on the hover over the icon in the entry right? and it doesn't seem to do that for me. Of course on this journal I do have the icon over in the subject line? Would that change it at all?

Reply

Re: Hmmmm.... av8rmike December 19 2007, 21:41:44 UTC
That's the new function added to Expressive's layout for thread expanding. Are you using a custom layout layer? You'll have to either switch back to the base layout or update yours accordingly.

Reply

Re: Hmmmm.... onlysayinghello December 19 2007, 21:44:08 UTC
Yeah I am using a custom layout layer... *sighs and goes to the code page thingie...*

Reply


mighty_z September 6 2008, 09:19:29 UTC
Is it possible to change expand link text?

When we wasn't allowed to use expanding comments in custom layers the text for the link was just written in EntryPage::print_comment function. So it was quite easy to create an option called something like text_expand_link and modify put a reference in expand link generation code. But when they made it possible to use expander in custom layers, link generation became too complicated for my understanding))

var Link expand_link = $e->get_link("expand_comments");
if ($e.thread_url != "" and defined $expand_link) {
" " + $e->expand_link({ "class" => "collapsed-comment-link" });
}

For example, what should I change in the code above to generate links like "show the thread"?

Reply

SOLVED mighty_z September 6 2008, 10:01:09 UTC
Sorry, I haven't noticed text_comment_expand property)

Reply


Leave a comment

Up