hiding records from multi-search
Hi Deborah -
Thank you, it works functionally but there is one caveat, the numeric result lists then don't function correctly. Say for example I type in a name that I know is in do not display, it tells me there is 1 record in my result but of course because of the code, the record does not display (this is the good part).
I was hoping to exclude it farther up in the process so the results numbers are accurate.
Hmm. I hadn't considered that.
Maybe this post will help:
Hi Deborah -
Funny enough, that is the post I was referencing in my initial posting that I did not understand (pasted below) - Damon makes reference to "the hidden checkbox on the record" which I could not find at all (unless it is staring me in the face) and "adding the following to the view options" and I was just unclear if it is the view options on the page (like below) or somehow in the CMS section. I wasn't sure if I was just supposed to create a "hidden" checkbox field and magically it would adopt those properties but since my "do_not_display" field was essentially the same thing with a different name. I included a screenshot of the current fieldlist in the leadership_sales section.
The alternative method he proposes is essentially the method you proposed and it has the same impact on the total count as your proposed method and i wanted to avoid writing record count code etc since the built in method does it so elegantly.
In any case, that is my current conundrum.
thanks again for looking around.
$searchTables['x_leadership_sales'] = array(
'viewerUrl' => 'about-leadership.php',
'titleField' => 'title',
'summaryField' => 'content',
'searchFields' => array('title','content'),
'ignoreHidden' => true,
One way you can exclude records from the multiSearch would be to use the "hidden" checkbox on the record. The record would then not appear in the search results.
To be able to link to the record directly and it have it display (even when marked as hidden) would require that you add the following to the View Options:
'ignoreHidden' => true, // don't hide records with hidden flag set
Hope this helps. If you need any additional details about the steps or have questions, just let me know.
I've not tried this myself, but am interpreting that it might work for you to rename your 'do_not_display' field to 'ignoreHidden', which appears to be a special fieldname within CMSB.
If that doesn't work, post back and perhaps someone else can provide a working solution.
Hi Deborah -
I had the same thought this am - the section editor does indeed indicate that "hidden" is a special field type but the 'ignoreHidden' => true, statement still causes a 500 error on the page. I feel like we are close but there is some (critical) piece of information I am missing.
Well...now I feel dumb....
After reading some more entries in the forum about "hidden" records and how they behave I discovered the interactive tools (not surprisingly) guys already thought of this. if you use the "hidden" field as the checkbox in your section editor to hide fields you don't have to do anything in the search array to exclude these hidden records, it happens automatically.
By setting this:'ignoreHidden' => true, I was actually doing what I did not want to do which was to ignore that hidden field and show the record...some days...
If others have this issue, as long as you use the "hidden" field in your section editor then all will be well.