[personal profile] sawyourwolfjunk posting in [community profile] style_system
Hi. I'm having a problem with the layouts that I've brought over from LJ. Namely, clicking on the expand link doesn't actually expand the link. It acts like I've hit 'thread'. I'm wondering if there's something I need to add to the code to get it to accept the expand button, so I'm hoping someone can take a look at it, found here, and let me know what/where I need to pop something in.

I've found this to be a problem with most of the layouts I've tried bringing over from LJ. I can customize them to fit DW specs more aptly (since some can get a little wonky with some of the dimensions), but this is the only problem I've had that I can't seem to figure out on my own.

Any help would be greatly appreciated.
Thank you.

Date: 2012-11-14 02:15 am (UTC)
chagrined: Winged Victory saying "FTW!" (ftw)
From: [personal profile] chagrined
Hooray, so glad! \O/ ~comments expanding all around~

Date: 2012-11-17 12:58 am (UTC)
marahmarie: (M In M Forever) (Default)
From: [personal profile] marahmarie
Having the same problem but I don't seem to have the same theme layer code to alter, even though I'm working from the same one as the poster above. All I have is this:
function EntryPage::print_comment_partial( Comment c )
{
    var string subject = $c.subject ? $c.subject : $*text_nosubject;
    var string date = $c->time_display("long", "");
    var string poster = isnull $c.poster ? $*text_poster_anonymous : $c.poster->as_string();

    print safe """<a href="$c.permalink_url">$subject</a> - $poster on $date""";
    var Link expand_link = $c->get_link("expand_comments");
    if ($c.thread_url != "" and defined $expand_link) {
        " " + $c->expand_link();
    }
}


And this:

###$comment->print_reply_link({"linktext" => $*text_comment_reply}); 

        if($comment.screened == true) {
            ### if comment screened - show link for unscreen
            var Link link;
            $link = $comment->get_link("unscreen_to_reply");
            """<a href="$link.url" title="$link.caption">$link.caption</a>""";
        } else {
            ### showing reply link if comment not screened
            $comment->print_reply_link({ "linktext" => $*text_comment_reply });
        }

        
        ") ";
    }

    if ($comment.parent_url != "")
    {
        "(<a href='$comment.parent_url'>$*text_comment_parent</a>) ";
    }

    if ($comment.thread_url != "")
    {
        """(<a href="$comment.thread_url">$*text_comment_thread</a>) """;
        var Link expand_link = $comment->get_link("expand_comments");
        if (defined $expand_link) {
            "(" + $comment->expand_link() + ") ";
        }
    }



So what exactly would I need to alter (and with what code specifically) to make this work? Thanks in advance. :)

Oh God, yes, it worked!

Date: 2012-11-18 04:16 am (UTC)
marahmarie: (M In M Forever) (Default)
From: [personal profile] marahmarie
Thank you! I tried copy/pasting the code I saw in the last replies before my comment and kept getting compiler errors because I was copying the entire code blocks, which don't match mine, which I think was throwing the errors. So I thought because I had different code (+ $c->print_expand_link(); vs. + $e->print_expand_link) that that was why adding print_ didn't work. And I was probably right.
Edited Date: 2012-11-18 04:19 am (UTC)

Date: 2012-11-17 02:29 am (UTC)
chagrined: Marvel comics: zombie!Spider-Man, holding playing cards, saying "Brains?" (brains?)
From: [personal profile] chagrined
sawyourwolfjunk is correct, you replace calls to expand_link() with print_expand_link(). So any time you find "->expand_link" in your code, replace it with "->print_expand_link".

The second part of my explanation was to split up strings IF changing expand_link to print_expand_link causes you to have problems with the spacing characters (the characters that show up before/after the expand link in your html). To do this, you just put each string on a separate line/expression. In your case:

" " + $c->print_expand_link();

becomes

" ";
$c->print_expand_link();


and

"(" + $comment->print_expand_link() + ") ";

becomes

"(";
$comment->print_expand_link();
") ";


but you only need to do that after you've replaced "->expand_link" with "->print_expand_link", if you have noticed it's botching your spacer characters. Mine did for some reason but this may not be the case for all.

Date: 2012-11-18 04:24 am (UTC)
marahmarie: (M In M Forever) (Default)
From: [personal profile] marahmarie
Yes, yes, the concatenation part I got, but I could never get that far with it because I was using your code ($e->print_expand_link, which does not exist in my theme layer) in place of my code (+ $c->print_expand_link, which can't be replaced with what you posted in your earlier replies on this page), which was throwing compiler errors for me whether I appended print_ or not. Sorry for the confusion.

Oh! And I'm not getting any weird spacing errors yet, but I haven't checked in IE, either. If those turn up I will indeed try concatenating like you said to see if that fixes it. Thanks for your help!
Edited Date: 2012-11-18 04:26 am (UTC)

Profile

Dreamwidth style system discussion

June 2025

S M T W T F S
1234567
891011121314
15161718 1920 21
22232425262728
29 30     

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 4th, 2025 10:47 am
Powered by Dreamwidth Studios