TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,021
  • Total Topics: 21,332
  • Online today: 744
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 160
  • Total: 160

Once again....readmore

Started by Bill.Ramby, March 05, 2007, 01:37:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Bill.Ramby

How difficult would it be to code a tag like;

[readmore]

I know it's been beaten to death, but when I have a long forum post that is going to appear on the front page, rather than cutting it off at a specific character count, I would much rather be able to insert a tag where I want it to cut off.

I have two reasons for this; a) not all posts are the same length and layout so a readmore tag would allow me to cut it off at a logical point in the post rather than an arbitrary point and b) the tag could place a "Read more..." link at the bottom next to the "Comments | Write Comment" tags already there (see attached screenshot).

Thanks in advance for any help.

JPDeni

Off the top of my head, it doesn't seem that it would be that difficult to do. You would need to change the coding in SSI.php -- or copy the code from there into a php block and then alter it.

The process would be something like
--check to see if [readmore] tag is in the post
--if it is, only display the post prior to the tag and print out Read more... link
--if it isn't, display the whole post

The biggest issue would be that you wouldn't want that tag to print out in the post in the forum. You could probably add a str_replace command to Display.template.php to eliminate it.

hygron

I just use an article block and it has an intro where you can edit the break anywhere you want.

click my link, and check it out on my frontpage.  All I have is articles.  then where I though the necessary info was clarified I put the rest of article on 2nd page.

readmore automatically is at bottom of 2nd intro edit window on your editor.  hope this helps.

Bill.Ramby

@ JPDeni: Thats the one thing my current portal doesn't doo, it wont hide the readmore tag in the actual post. Sadly I've learned to live with it. ;D


@ hygron: I understand using the readmore in articles, but my preference is to use posts. That way all the comments are in one place, the forum. Nice looking site BTW. :)

hygron

thanks WR...I understand what you were asking better now.

Are you talking about on a case by case basis?;  After finding it on frontpage? 

Wouldn't the simple way be to edit the source code in post, and put balance of article on html page via "readmore" link?  nahhhh

wouldn't that be coded in the template?

Bill.Ramby

I have no clue where it's coded. PHP isn't my strong suit. :o ;D

This website is proudly hosted on Crocweb Cloud Website Hosting.