Kenzi (
sawyourwolfjunk) wrote in
style_system2012-11-13 03:23 pm
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[community profile]](https://www.dreamwidth.org/img/silk/identity/community.png)
Expand issues with transferred layouts
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.
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.
no subject
no subject
Pretty sure I don't use blockers of any kind. I'm on Chrome and I only have a very small handful of apps on that.
no subject
I also looked in my own journal to see what it did, and had to go a while back be4 I even found an entry that had threaded comments, ha, but I found one and mine seems to be doing the same thing (redirecting to the thread link rather than loading the iframe in-page). Hmmmm.
Okay, well, I compared an entry on my journal to one using ?style=site. Looks like the links for expand on the LJ-style-theme I'm using are not loading the javascript script.
Links on my theme: <a href="threadurl">Expand</a>
Links on ?style=site: <a onclick="Expander.make(this,'threadurl','thread#', false); return false;" href="threadurl">Expand</a>
(where you wanna replace threadurl with the whole url for that comment thread, and thread# with the thread # that is part of that url at the end)
So, probably if you added that extra html to run the javascript to the expand links in your custom S2 style, it would work?? I will try to test this out also though maybe in a bit, can't do it right now, but thought I'd share preliminary thoughts anyway. :)
no subject
I was sort of hoping for a, "Oh, sure, just add
.gobbledygook css
in after your comment page and it should be fine."
Yes. I clearly fail.
no subject
Poking around the S2 code now and suspect the problem may be using expand_link() rather than print_expand_link() in several places. Will endeavor to fix it! :3
no subject
no subject
So, the problem is indeed using expand_link() rather than print_expand_link(). If you search your layer code for "->expand_link" you should see around 2 places (maybe more depending on your style) this shows up. Replacing them with "->print_expand_link" makes it work. UNfortunately, on my style at least, this seems to mess up the spacing characters before that link item. Not quite sure why that's happening. It has me scratching my head; it's throwing the spacing characters on AFTER the link item instead of before it. So that's bizarre and I'm still trying to figure it out. But the expanding functionality is working correctly.
eta: okay, still don't really know WHY that weird problem with the spacing characters was happening, but I fixed it anyway. If you have the same problem, here is how to fix it:
when you search for "->expand_link" (which you will replace with "->print_expand_link"), you'll see it show up inside some brackets. For example, here is one of the ones that shows up for me, with a separator character in quotation marks, concatenated (the plus sign) with the return from print_expand_link():
{
" " + $e->print_expand_link({ "class" => "collapsed-comment-link" });
}
All you need to do is break this up so instead of concatenating them as one expression, each is on its own line:
{
" ";
$e->print_expand_link({ "class" => "collapsed-comment-link" });
}
Problem solved! :D
P.S. This was fun to figure out and now I'm glad that expanding comments will work on my own style as well! So thanks a ton for asking it here! :D :D
no subject
I'm going to go fart around with it now, and I'm really, REALLY glad you helped figure this out. Thank you kindly, and I'll let you know if it works appropriately for me :D
ETA:
Just tried it your way and it works like a peach. Thank you :)
no subject
no subject
And this:
So what exactly would I need to alter (and with what code specifically) to make this work? Thanks in advance. :)
no subject
Where it says " " + $c->expand_link(); turn it into " " + $c->print_expand_link();
It's the same for the "(" + $comment->expand_link() + ") ";
add the print_ before the expand_link and you'll be fine.
Oh God, yes, it worked!
+ $c->print_expand_link();
vs. +$e->print_expand_link
) that that was why addingprint_
didn't work. And I was probably right.Re: Oh God, yes, it worked!
Nice to know that a problem I was having was a site-wide one :)
I hope this little ditty helps, and muchos love to
no subject
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.
no subject
$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 appendedprint_
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!