1 of 2
1
HTML Stripped from Search Results
Posted: 08 July 2004 12:28 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  463
Joined  05-31-2002

It looks like currently HTML code in entries is converted to entities and displayed in search results.  This is currently breaking my design since it seems the cell wants to be as wide as it decides it’s going to be instead of using the width I’ve assigned it (here’s an example or if that’s old, just try searching for “leah”)

Wouldn’t it be wiser for HTML code to be stripped completely from the search results to avoid things like this from happening?  It doesn’t really look good either when a bunch of HTML is displayed in the excerpt.  I don’t have much use for summary fields and don’t use them, therefore my excerpt is always pulled from the main entry.

 Signature 

So Very Posh .:. Media Blog - Television, Movies, Books, Polls and more.

Profile
 
 
Posted: 08 July 2004 12:34 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32773
Joined  05-14-2004

I have the same problem, just figured it was me and well - was too much going on to post here.  But I’d rather it *respect* the HTML because it looks really crappy otherwise. =)

 Signature 
Profile
MSG
 
 
Posted: 08 July 2004 12:40 PM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  463
Joined  05-31-2002

The problem with keeping the HTML intact is that there’s a cutoff after a certain number of characters so you’d have open tags.  I’m skeptical about resolving open tags (I still think that looks tacky) and would prefer the HTML to be stripped altogether since that won’t look bad.

 Signature 

So Very Posh .:. Media Blog - Television, Movies, Books, Polls and more.

Profile
 
 
Posted: 08 July 2004 12:48 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32773
Joined  05-14-2004

What about an option to restrict search results to the first paragraph or something? I guess thats a problem where one is not using p tags or something, though…..

If it were up to me I’d respect the html but if there is a tag in there, make sure it is closed before ending the excerpt - html code should not count against the character count….

 Signature 
Profile
MSG
 
 
Posted: 08 July 2004 12:55 PM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  463
Joined  05-31-2002

If it’s going to go that route, I’d rather it be optional.  I don’t really want links and lists, etc showing up in my search results.  I frequently use a lot of HTML in my entries and having that show up in the search results would be ugly. 

Stripping the HTML out completely would require inputting maybe one or two lines of code - it’d be an easy hack I’m sure.  Closing tags is far more intuitive and complex. 

 Signature 

So Very Posh .:. Media Blog - Television, Movies, Books, Polls and more.

Profile
 
 
Posted: 08 July 2004 02:28 PM   [ Ignore ]   [ # 5 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Would a plugin that stripped out HTML even when converted into entities help?

 Signature 
Profile
 
 
Posted: 08 July 2004 03:12 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  463
Joined  05-31-2002

Yeah, that would work.  I made a terribly simple plugin that strips HTML for other uses, but of course that doesn’t work on search engine results since they’re converted into entities.

 Signature 

So Very Posh .:. Media Blog - Television, Movies, Books, Polls and more.

Profile
 
 
Posted: 08 July 2004 03:24 PM   [ Ignore ]   [ # 7 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

OK, just finished the plugin.  I will send you an email so you can test it out.

 Signature 
Profile
 
 
Posted: 08 July 2004 05:15 PM   [ Ignore ]   [ # 8 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32773
Joined  05-14-2004

that’d work for me too - and i agree lynda, i’d even want my option on a per weblog basis, complicated. =)

 Signature 
Profile
MSG
 
 
Posted: 08 July 2004 05:17 PM   [ Ignore ]   [ # 9 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

I sent Lynda the plugin, but if you want to play with it too…you know where to email.

 Signature 
Profile
 
 
Posted: 11 July 2004 07:38 PM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  838
Joined  04-24-2002

So… how did that plugin turn out, Lynda?  I would be interested in using it as well in search results, as long as there’s no hacking of the EE files in order for it to work.

 Signature 

chrisruzin.netTextMate EE BundleTextMate EE Developer Bundle • Pro Network member
“The greatest barrier to success is the fear of failure.” - Sven Goran Eriksson

Profile
 
 
Posted: 11 July 2004 07:58 PM   [ Ignore ]   [ # 11 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

It’s funny.  Three people requested this plugin via email and not a single person ever got back to me about it.  So, I can only assume it worked perfectly or was utter crap.

 Signature 
Profile
 
 
Posted: 11 July 2004 08:45 PM   [ Ignore ]   [ # 12 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32773
Joined  05-14-2004

Paul, I’ll email you right now - been a bit out of it.  I promise to give feedback if you send the plugin. wink

 Signature 
Profile
MSG
 
 
Posted: 11 July 2004 09:11 PM   [ Ignore ]   [ # 13 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32773
Joined  05-14-2004

Works perfectly once I got past being an idiot.. thank you so much paul!

 Signature 
Profile
MSG
 
 
Posted: 11 July 2004 09:55 PM   [ Ignore ]   [ # 14 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  838
Joined  04-24-2002

Waant.  Neeed.  *paws the air in the direction of the plugin*

Is it going to be added to the EE Plugins site soon?

 Signature 

chrisruzin.netTextMate EE BundleTextMate EE Developer Bundle • Pro Network member
“The greatest barrier to success is the fear of failure.” - Sven Goran Eriksson

Profile
 
 
Posted: 11 July 2004 10:02 PM   [ Ignore ]   [ # 15 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Probably tomorrow after I finish another plugin.

 Signature 
Profile
 
 
Posted: 11 July 2004 10:20 PM   [ Ignore ]   [ # 16 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  838
Joined  04-24-2002

Excellent!

Hey… has anyone ever told you that you rock?  Cause… you do, you know… rock…

 Signature 

chrisruzin.netTextMate EE BundleTextMate EE Developer Bundle • Pro Network member
“The greatest barrier to success is the fear of failure.” - Sven Goran Eriksson

Profile
 
 
Posted: 12 July 2004 08:51 AM   [ Ignore ]   [ # 17 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  463
Joined  05-31-2002

You do rock, Paul.  Unfortunately, I don’t have time to test the plugin right now, but I do appreciate receiving it.

 Signature 

So Very Posh .:. Media Blog - Television, Movies, Books, Polls and more.

Profile
 
 
Posted: 13 July 2004 05:57 PM   [ Ignore ]   [ # 18 ]  
Research Assistant
RankRankRank
Total Posts:  342
Joined  05-03-2004

If you want your search results to end at a point other than what EE considers to be the 50th word, you can use the Filter_HTML plugin to do the job.  You can ask it to strip tags too.  The only catch is that you need to insert a hack into EE code that provides a variable that evaluates to the full entry rather than just the first 50 words (so Filter_HTML can see the original HTML and do its own thinking about where to truncate it).

If you’re happy with 50 words (or what EE considers to be 50 words), or if you don’t want to add a hack, Paul’s solution is best.

~joe

Profile
 
 
   
1 of 2
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64535 Total Logged-in Users: 20
Total Topics: 81113 Total Anonymous Users: 28
Total Replies: 436440 Total Guests: 188
Total Posts: 517553    
Members ( View Memberlist )
Newest Members:  marlusbluespotmusicvolandspinhirnetheminiokostiamasterjeMBossbchaleyalvonsius