Jul 05, 2009, 08:43 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Search via SMF or Google: modx forums all of modxcms.com web
  MODxCMS.com   Forums   Help Login Register  
News:Read what MODx Developers say: MODx Dev. Blogs
Pages: [1] 2   Go Down
  Print  
Author Topic: [Snippet] Little modification of FlexSearchForm  (Read 9011 times)
0 Members and 1 Guest are viewing this topic.
MadeMyDay
Moderators
*
Posts: 911



WWW
« on: Feb 07, 2006, 03:01 PM »

Hi,

I just modificated the FlexSearchForm a bit and think perhaps someone is interested in it Wink My problem was that I built a site and didn´t fill out the description of the pages and so the search results are not that informative (as the results on the modxcms page). That was the first time I found something that joomla does better, so I transferred that functionality to modX.

What it does: With displaying search results you´ll get an extract of the context with highlighted search term. Also multiple words are possible and are highlighted the google way Wink

See example here:

www.mademyday.de/ifa

Search for example for "familie" (german site), you will see what it does.

In the snippet you can configure the variable $extract to either true or false, which will (surprise!) show the extract or not. There are two CSS classes used, FSF_extract for the div container with the extract and a span class called FSF_highlight for highlighting the text in this extract (yellow background in the example above)

This is not the standard FSF, I translated some words and changed a few settings, but I think you guys will get it (no time to put in the standard FSF yet).

Greetz Marc

EDIT: New version with different colors for every phrase (FSF_highlight1, FSF_highlight2 etc.)

* FlexSearchForm.txt (17.23 KB - downloaded 472 times.)
« Last Edit: Feb 07, 2006, 06:07 PM by MadeMyDay » Logged

rthrash
Foundation
*
Posts: 10,471



WWW
« Reply #1 on: Feb 07, 2006, 04:10 PM »

OK so that absuletly rocks. We will most likely add this to the default core distribution... thanks!

Any way to have it use an array of color definitions when putting in multi-item searches, like searching for "familie durch Doppel".
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
MadeMyDay
Moderators
*
Posts: 911



WWW
« Reply #2 on: Feb 07, 2006, 04:16 PM »

Quote
OK so that absuletly rocks. We will most likely add this to the default core distribution... thanks!

You´re welcome, glad to give a little bit back to you guys Wink

Quote
Any way to have it use an array of color definitions when putting in multi-item searches, like searching for "familie durch Doppel".

Don´t understand now, do you mean seperate definitions for the terms? E.g. "familie" in yellow, "doppel" in blue and so on? I´ll try Wink

Greetz Marc
Logged

rthrash
Foundation
*
Posts: 10,471



WWW
« Reply #3 on: Feb 07, 2006, 04:34 PM »

exactly mark...it's the way that Google does it I think for cached page views:

http://64.233.179.104/search?q=cache:qEqwrLh01bkJ:www.angelfire.com/gundam/simplykat/blog/+one+two+threee&hl=en&gl=us&ct=clnk&cd=1&client=safari
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
MadeMyDay
Moderators
*
Posts: 911



WWW
« Reply #4 on: Feb 07, 2006, 04:39 PM »

No problem I think. What do you think is better: To highlight like <span class="FSF_highlight1">one</span> some text <span class="highlight2">two</span>bla bla text... or to define the colors in an array in the snippet itself? I would prefer to define highlight1-x in the CSS. (I already did that local, just have to highlight the search header like googel Wink ).

Greetz Marc Cheesy
Logged

steph
Member
**
Posts: 85


WWW
« Reply #5 on: Feb 07, 2006, 04:46 PM »

Thanks Marc, that's great, just what I was looking for.

For anyone who wants English, here it is with all config back to the modx defaults.

Steph

* FlexSearchForm.txt (16.38 KB - downloaded 325 times.)
Logged

Briggsy
Sr. Member
****
Posts: 372



WWW
« Reply #6 on: Feb 07, 2006, 05:45 PM »

Awesome, can't wait to get back from my few days away on courses and implement it.

Had trouble with the original highlight option (think it was Sottwells) so be cool to bust this one out and have a go  Wink
Logged

Emergency Management Academy of New Zealand
      http://www.emanz.ac.nz

MODx Sandbox   Login: sandbox  Password: castle

Admin Sandbox   Login: sandbox  Password: castle
MadeMyDay
Moderators
*
Posts: 911



WWW
« Reply #7 on: Feb 07, 2006, 05:45 PM »

Okay, here we go:

www.mademyday.de/ifa

Try with Ryan´s funny search "familie doppel durch" (means family double through Cheesy ).

Changed the attachement from the first post.

@Steph: Would you be so kind to translate/set it back to standard, have to finish this site this night (we have 1 o´clock here) :-/

Greetz Marc

PS: I´m not a coder, this could surely be more properly, so if anyone likes to improve it... go on Wink
Logged

rthrash
Foundation
*
Posts: 10,471



WWW
« Reply #8 on: Feb 07, 2006, 06:03 PM »

Nice work! You going to update the source and share for everyone here?
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
MadeMyDay
Moderators
*
Posts: 911



WWW
« Reply #9 on: Feb 07, 2006, 06:06 PM »

Quote
Changed the attachement from the first post.

Quote
EDIT: New version with different colors for every phrase (FSF_highlight1, FSF_highlight2 etc.)


Wink
Logged

rthrash
Foundation
*
Posts: 10,471



WWW
« Reply #10 on: Feb 07, 2006, 06:07 PM »

Totally missed those. lol
Logged

MODx is a framework that allows web professionals to turn over sites to end-users for daily maintenance without worrying. Community participation and questions are encouraged, especially when you help us help you, read the wiki, and review snippet parameters – even if you have to look at the source. Searching the forums helps, too.
Ryan Thrash
MODx Co-Founder
Principal @ Collabpad
work productively.
work intelligently.
work together.
steph
Member
**
Posts: 85


WWW
« Reply #11 on: Feb 07, 2006, 06:24 PM »

English version.

* FlexSearchForm.txt (17.25 KB - downloaded 361 times.)
Logged

MadeMyDay
Moderators
*
Posts: 911



WWW
« Reply #12 on: Feb 07, 2006, 06:26 PM »

thx steph Smiley
Logged

Mark
Coding Team
*
Posts: 3,250


Ditto Developer


WWW
« Reply #13 on: Feb 08, 2006, 12:14 AM »

One word...AWESOME!!!

Marc --- THIS ROCKS!!!
Logged

xwisdom
Foundation
*
Posts: 1,732



« Reply #14 on: Feb 08, 2006, 12:42 AM »


Very nice snippet Marc!
Does your version also searchs the summary fields?

The only thing that's needed now for this snippet is for it to support more input params and a template (&tpl)
Logged

xWisdom
www.xwisdomhtml.com
The fear of the Lord is the beginning of wisdom:
MODx Co-Founder - Create and do more with less.
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP

Copyright © 2005-2008 MODxCMS, All rights reserved. Contact Us
Styles by ziworks.com

Powered by SMF | SMF © 2006-2008, Simple Machines LLC

Valid XHTML 1.0! Valid CSS!