Recent Topics

1 Aug 31, 2004 10:05    

I'd like to see the modification of the "read more" function. Instead of linking it to the permalink page, where it shows the full entry, i want the "read more" link to act as a collapsing/expanding script, so readers dun have to go to another page to read the full post, and they can click the "read less" link to hide the extended entry. I've seen this on many other blogs, and i believe they got [url=http://www.scriptygoddess.com/archives/2004/01/06/another-revision-to-the-showhide-script/]the codes[/url] from scriptygoddess.com. It would be cool if b2evo has it too.

Thanx in advance ;)

2 Aug 31, 2004 12:57

it is on the planning, there are others too who asked for it.
don't know when it will be released (even if it will be concluded in the next relase)

Our dev team is very short handed at the moment, so, if you can provide code, be our guest ! (and take contact with Fran?ois - fplanque)

3 Aug 31, 2004 19:08

You can do this now, but it's a bit freaky. Here's how.

1. In your skin's _main.php, near the top, add this:

<?php $more=1; ?>

(If that doesn't work, try it in the stub file or in index.php.)

2. In the skin's _main.php, where the content is called, do this:

<div class="bPost">
<?$Item->content( '#'  , 1,  '', 
'<a id="opener' . $Item->ID . '" class="opener">Read More!</a> <div class="openclose" id="openclose' . #Item->ID . '">', '', '', 'htmlbody', 0, false); ?>
  </div><!-- end of the "more" container div -->
</div><!-- end of the "bPost" div -->

Now, you've got XHTML like this:


<div class="bPost">Teaser Teaser Teaser Teaser Teaser Teaser
<a class="opener" id="opener123">Read More</a>
<div class="openclose" id="openclose123">More text More text More text More text More text More text More text More text More text More text More text More text 
</div>
</div>

No matter whether "more" is set in the URL or not.

3. The fun part: JavaScript!
You've got to create or find a function that will loop through the elements on your page and add functions to show/hide the openclose DIVs whenever the corresponding A tag is clicked. (Basically, add an onClick event to the A elements, which finds and shows/hides the corresponding DIV by the ID. Contact me if you want my help creating such a function. I don't have time to do it, but I can help.)

When it comes to putting XHTML and JavaScript in the browser, there's very little that b2evo can't do!

4 Nov 06, 2005 23:47

I hope this will be an option in the settings rather than a standard. I personally prefer it going to the next page.


Form is loading...