Question
How would I construct a search string to search for the same term in multiple fields in multiple forms? My situation is this: I have a system for inventorying a website, in which each page has modules that can appear in the left and right columns. Each page type (there are three) has its own form attached to it to, but all forms have a field called
Modules on the Left and another called
Modules on the Right. I want to create a search string that would go out and find all the pages, regardless of type, where a module appears. If my page forms were called PageTypeOneForm, PageTypeTwoForm, and PageTypeThreeForm, and I was looking for ModuleOne in both the
Modules on the Right and
Modules on the Left fields, what would the search string look like?
Environment
--
PhilGochenour - 18 Jan 2008
Answer
If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.
This is untested:
%SEARCH{ "META\:FORM.*PageType[A-Za-z]*Form;META\:FIELD.*Modules on the (Right|Left).*Value\=" type="regex" nonoise="on" format="| $topic | $formfield(Modules on the Right)$formfield(Modules on the Left)|" }%
--
PeterThoeny - 18 Jan 2008
The solution turned out to be much simpler than expected; because the form field names were the same in all the forms, I didn't even have to specify which forms to search in, it just hit the identically named fields in all the forms and returned my info. Here is the string I wound up using:
%SEARCH{ "[M]odules on the (Right|Left).*=.*[R]elatedVideos" type="regex" nonoise="on" format="| $formfield(Page Name) | $formfield(Page Type)| $formfield(Page URL)|" }%
--
PhilGochenour - 18 Jan 2008