WordPress Collapsible More Link Plugin

by Christopher on May 31st, 2005

This plugin has moved: WordPress Plugin: Inline (Collapsible) More Link

From General

44 Comments
  1. churchtown permalink

    I use the ShortStats plugin and when viewer clicks a More Link the viewer gets the information shown but my stats do not show that interest…

  2. Chroder, I been looking for this kinda of mod, Come here and have a cookie! :D

  3. Great stuff! I’ll use this for writing about movies and hiding spoilers.
    One detail… or two actually:
    Would be handy to have the more link tag in the control panel somewhere. Now I have to store it in a text file because I’m unable to remember stuff like that.
    Also: when you click show more, you get a double-spaced gap in your article, which is sort of unesthetic. Well… I’m fanatical about these things. Most people aren’t.
    In any case… thank you! This is a good thing!

  4. Would be handy to have the more link tag in the control panel somewhere.

    I’ll check this out. I’ll see if there are any easy ways to add a new button to the post editor other then editing the source files (I have yet to take a hard look into the available hooks WP has to offer).

    when you click show more, you get a double-spaced gap in your article, which is sort of unesthetic.

    This is due to the use of div’s. My original thought was that the more link would always be in the middle of two chunks of text. I will look into changing the behaviour so it is similar to the default more link (thus, literally inline ;-))

    Thanks for your comments KalleKanin :)

  5. Ok great! Thank you for responding to my response! And thank you again for the plugin!

  6. Tech Wench permalink

    Okay…got the quicktag thing working…I think…

    http://www.techwench.com/05-2005/plugin-square-off/#quicktag

  7. Oh, is that what you were going on about in your comments? :-D

    Thanks, I’ll include it next release :-)

  8. Tech Wench permalink

    lol. yeah, that’s what I kept FUBARing. :P

  9. Er… so should I add this code snipplet myself? I could do that, but I need to know exactly where. I’m not a complete idiot, just a halfwit. I can cut-and-paste but I have no idea what any of those lines of magic formulas mean. :)

  10. rizwan permalink

    hey, I uploaded the plugin but the ‘read more’ links keep linking to another page instead of opening more text right below the links. Any ideas? I’m not using default theme, and I’m on WP 1.5.1.2.

  11. rizwan, the default text token is different than the default wordpress <!–more–> (see the post above).

    You can change the plugin so it works over the default by editing the $token variable in the plugin file.

  12. I, too, don;t know where to place the text to get this to function. Could someone please spell this out for me? I have it uploaded to the proper directory already…

  13. H2ORANGE: Just put this text within your post:

    [code lang="xml"][/code]

    And it will create the more/less links. The editor button is not included with the download, it will be in the next release. (Sorry for the delays everyone, I’ve been extremely busy).

  14. Still not working for me, and it’s activated. Something else must be off. Oh well…

  15. Make sure the included template is uploaded as well.

  16. tylerwillis permalink

    Looks like a great plugin, but I ran into two problems with it.

    It installed and activated fine.

    I tried it on a text only post, and it worked – but the text that was hidden originally popped out as one giant run-together paragraph. No line breaks whatsoever – thus making it unreadable.

    I then tried it with one of my HTML formatted posts, and it worked, displayed fine, but at the end it errored out with an followed by a few lines of code.

    I’m deactivating for now, but I hope that this feedback can help you troubleshoot for a future release. Thanks.

  17. Learned about this from Chris DiClerico’s link to you (http://chrisdiclerico.com/2005/07/23/collapsible-more-link/).

    Works like a charm. It’s so much more elegant than that clunky permalink jump.

    D.

  18. Same here as tylerwillis on the first issue – installed fine, but the hidden text squished all my paragraphs together. :( Bummer. If this issue was fixed asap, it would be perfect….thanks sincerely for all your hard work! ^_^

  19. philosophus permalink

    Are there known issues with Semiologic? I can’t get the “collapsible more” to work; I use a slightly modified version of the “strawberry cream”-Theme, “more” works just fine.

    I love to use this elegant plugin on my blog. (I’ve seen it in action on the page of a friend and was very pleased with the aesthetics.)

  20. I too wanted to change the QuickTags and even though I know very little about PHP, and even less about Javascript, I plunged ahead and finally got the result. I intended.

    YMMV, and I offer no support. Be sure and make a backup of your file first. This will replace the QuickTag, More, with More|inline.

    Open > wp-admin > quicktags.js in your text editor.

    Find:

    edButtons[edButtons.length] =
    new edButton(’ed_more’
    ,’more’
    ,”
    ,”
    ,’t’
    ,-1
    );

    Change to:

    edButtons[edButtons.length] =
    new edButton(’ed_more|inline’
    ,’more|inline’
    ,”
    ,”
    ,’t’
    ,-1
    );

    Hope this helps someone who, like me, has CRS!

  21. Seems like this stopped working suddenly. Must have happened in the last week or so. Maybe because I upgraded to WP 1.5.2? Seems like that is the only explanation. I do have a couple of new plugins, but I have tried to disable those and it didn’t help.

    Have disabled your plugin for now in mortal fear of more bugs.

  22. OzBigBen permalink

    Terrific plugin. It’s very useful with the IImage Panorama plugin as well. This plugin allows you to display panoramas via a java applet in posts but this can create performance issues.

    Your plugin lets you hide the applet until the reader wants to look at it, improving the performance of pages listing posts with panoramas.

  23. courtney permalink

    Okay…my question is…

    i have WP 1.5 installed…your plugin is installed and activated..

    do we put this:

    before and after the text we want hidden?

    I’m trying to make it so there is text that is hidden and there is text after it that MAY NOT be hidden…

  24. redwolf permalink

    What is the syntax to use this as you have used it for the Release Notes, Upgrade Notes, & Tips sections above? Using WP 1.5.2…

  25. Actually the Release Notes/Upgrade Notes/Tips is using some custom javascript I just posted in the post. That isn’t what this plugin does :)

  26. redwolf permalink

    Would you consider sharing the JS? ;-)

  27. You can view the source ;) I made a post on this the other day: Remembered Collapsible Objects with PHP and Javascript, which is just an extended features version of a simple one I made a while ago: Collapsible Tables with Javascript.

  28. Streetwise permalink

    throws an error for me:

    XML Parsing Error: mismatched tag. Expected: . Location: http://www.daveandholly.com/ Line Number 47, Column 310:

    Any ideas? works just fine. I tried copying ‘collapsible_more_link.php into my theme folder, but that didn’t work either.

    Thanks

    Dave

  29. OldGuy permalink

    Love the plugin!

    From an earlier comment…”when you click show more, you get a double-spaced gap in your article, which is sort of unesthetic.”

    Did you ever figure out how to get rid of it? It isn’t the div that causes it but the closing P tag that WP adds to the end of the text seqment that is the culprit. Seems to me that if the closing P tag was stripped then simply adding a “display: inline” to the div in collapsible_more_link.php would move the link to the tail end of the last line just as it is when using the WP more tag.

    I’m don’t have enough PHP expertise to figure out how to strip the last </p> from the first text segment otherwise I would do it myself.

  30. OMG, mine is so hosed up now since I upgraded to WP 1.5.2; I do have one standard theme that I installed after the upgrade, and the collapsible more plugin works. On my older (custom) themes, it doesn’t work any more–it does the same thing Rizwan said in comment #10 above.
    I didn’t understand the answer about the token.

    Also, when I first installed the plugin before the latest release, I did what Geezer said (commennt #20) to change the “more” to “more | inline” on the quicktags, but since I upgraded the PLUGIN, I now have that PLUS a “collapsible more” quicktag.

    I don’t know what “template” you’re talking about in “Upgrade Notes” step 2.

    Lots of questions, I know…I’m no expert but I’m not totally clueless. VERY confusing instructions! Please help?

  31. I don’t know what “template” you’re talking about in “Upgrade Notes” step 2.

    Nevermind that line, I made the changes. It’s still not working though; clicking “Show More” still opens up the individual permalink/post page.

    (And of course I still have the two inline more quicktag buttons.)

  32. Beth: The template responsible for inserting the actual more/less links has been updated. The instructions state that if you modified the template from the old release of this plugin, that you will have to update them to this new “format”. If not, you can simply delete the template file from your custom theme directories.

    There is one master template file that is located in the MoreLink directory. It will always be used if a local template was not found. So: plugins/MoreLink/collapsible_more_link.php will be used if themes/[your theme]/collapsible_more_link.php is not found.

    If you have this collapsible_more_link.php template file in your custom theme directories, then either update them or delete them (to make the plugin use the master template). The only time you should ever have a custom collapsible_more_link.php template for a theme is if you need to modify it for something.

    As for the extra button in quicktags, just undo what Geezer said (remove the “|inline” from the lines specified, I believe). The difference in syntaxes (”more” compared to “more|inline”) lets you use either the plugin, or the stock Wordpress “more…”. Having both buttons gives you a choice of which one you want to use, which is A Good Thing. You wouldn’t want to collapse 10,000 characters, for example.

  33. OldGuy: Did you try the “Make the collapsed text appear on the same line” tip in the main post? Surrounding the entire bit of text with a div should stop wordpress from putting the extra P tags in, it did in my tests.

    Note that it also depends on how you write your post. If you put linebreaks after the <!–more|inline–> tokens, then you will get them ;)

  34. OldGuy permalink

    Chris: Did not see that tip in this post or its comments. Not sure what you mean by the “main post.”

    I’ve been futzing with it since writing my first comment and got it to work by changing (in collapsible_more_link.php) the div’s (following the before_text and after_text echos) to spans and concatenating them with before_text and after_text. This way I don’t have to remember to wrap the more text in a div every time I write a post that uses more.

    Here’s how the changed code looks:

    Read More... »' ?>

    ">
    « Collapse'; ?>

    Originally tried putting a display inline style in the div. That got rid of the </p> but in its place was a break…????

    Anyway, all is fine now and it looks purdy. Thanks again for the nice plugin.

  35. Thanks for clarifying, Chris, it’s working perfectly again!
    (I deleted the templates from the themes.)

    Thanks for the great plugin! :-D

  36. OldGuy permalink

    Oops, I wrapped it in code tags but it looks like they are ignored on comments. Sorry about that.

  37. If you want to see what I did to eliminate the line break the modified file is here:

    http://www.oldguy.us/public/collapsible_more_link.txt

  38. OldGuy: That’s what the tip says ;P By “main post” I meant the actual blog entry for this plugin (ie: scroll to the top of the page). There is a “Tips” section (click to uncollapse the contents).

  39. Hm, got some slight problem.

    I changes the <!–more|inline–> to <!–more–>, but WP only shows the old Links to the normal More Page. Any ideas? Oh well, I use several plugins that alters the output, like WP-Define, SH-Autolink, Dynamic Text Replace.

    Bye
    Michael

  40. Ok, found out: <!–more–> doesn’t work, I had to use something like <!–more1–> instead. Any idea why it is so?

  41. Mike H permalink

    For anyone having trouble with the plugin messing with paragraph formatting below the fold, try deactivating Markdown and using the Textile plugin instead. D’oh! ;)

  42. Mike H permalink

    Oh yeah, almost forgot: many thanks for the plugin, Chroder.

  43. orbz permalink

    Neither of the fixes (the ‘official’ tip one or OldGuy’s) work for me
    They add the disadvantage of the read more link being jammed right next to the text instead of aligned to the right, and dont do anything about the added line break… even when i used them like
    line1 line2
    without any line breaks whatsoever, it still gives me the double space.

  44. orbz permalink

    hey, if you’ve got a piece of text hidden as handled by this, will search engines be ok picking it up?