Support Forum
Janet, I'll play around with it this afternoon and see what I can do. I don't write much code. I mostly tweak other peoples work to suite my needs. I was looking it over and think I understand enough of what I saw to help.
Unless of course someone with the actual skills steps in [Image Can Not Be Found]
Thanks Lee. I am swamped at the moment and Steve's young son has his first varsity football match tonight so he wont be around much either.
YELLOW
SWORDFISH
|
Janet I whipped a new template tag. Here's a pic and tell what to change. You would need to style it. I cheated and styled with Firebug to bring it all together. Added the black border too. Sorry so brief. Company is coming 🙂
[Image Can Not Be Found]
Set to show 5 posts and chopping at a word at no more then 100 characters. Then add ... at the end of chop. Note first post was less than 100.... so it was safe from chop.
This looks great. Can I make one suggestion.
Are you filtering the post content at all? The best filter to use for this would be:
$content = sf_filter_tooltip_display( $content, $status );
because that will remove any html tags that might cause havoc if spilt by the word count. This is the filter we use for displayng the tooltip when you hover over first/last posts etc.
The $status paramater is the current post_status field from the sfposts record. if it is true - and the user is not an admin or moderator - then it wil display that the post is awaiting moderation instead of the actual post content.
YELLOW
SWORDFISH
|
Wow! I really should think twice about doing a hasty post. I'm not even sure I can figure out what the heck I wrote. Sorry about that [Image Can Not Be Found]
@ Yellow Swordfish... you're the best! I was stripping out the html tags, but that filter is so much better. Especially the status option. I hadn't thought that far ahead. I was digging around all the filters yesterday for the first time, but since I only seem to understand about 70% of what I'm reading, skimming through that much code got overwhelming in a hurry. I'm glad to use a "tested" internal filter rather then introducing my own anyhow 🙂
I did bypass the sf_rss_excerpt since words vary in length so much and I wanted the excerpt lengths to be more consistant in visual length, since I'm assuming this tag will be used in tight places. So I opted to include a filter that goes by character count, the finds the closest word at that point to split without exceeding the limit. Once again I'd prefer to use a function included with SP so if there are other options I haven't discovered, I'd be happy for another hint.
@ Janet... What I was trying to say earlier was I'm happy to word this any way you choose. I'm unclear exactly, since so many ideas were thrown out on the table in this thread. So if you can type out a "demo" example for me I can save you some code edits if it isn't exactly as you were expecting.
Thanks - I really appreciate all your help. I will check with my client today and let you know what they decide.
Lee, your example is great! I'll be able to change the number of posts and the length of the excerpt simply by changing the numbers in brackets?
One tiny request - they would prefer to have the second line in this order:
posted username, date by
Thank you so much!!
No problem with the changes. I'll have the code and directions posted here in about a hour. And yes, you have control of posts listed and how much of the post you want displayed by adjusting the numbers. Oh... you also have control of the trailing "...". You can specify what you want it to be.
Back in a while
Lee
JanetBarclay said:
posted username, date by
@Janet... I think I may be confusing myself.
You're saying you would like the second line to read like this?
Posted JanetBarclay, Sep 2, 2010 by
Surely I'm mistaken? Please type me a example line including a sample username, date, punctuation and wording so I can be certain 🙂
1 Guest(s)