CMS MADE SIMPLE FORGE

News Module

 

[#1978] limiting search module access by category

avatar
Created By: Steve Mann (sep)
Date Submitted: 2007-12-19 02:14

Assigned To:
Resolution: Won't Fix
State: Closed
Summary:
limiting search module access by category
Detailed Description:
Is it possible to add a 'Not Searchable' flag to categories? Our sites are very
News-Module reliant and we have a category set up to be viewed specifically by
logged-in members only. At the moment, search either reveals everything to
non-members (defeating the point of logging in) or if news is removed from the
search, search returns virtually nothing as most content is in News.

History

Comments
avatar
Date: 2014-09-02 06:13
Posted By: Leo Holsti (lholsti)

I would second this. The ability to filter searchable categories for different
users would be great.

This could be implemented by allowing access to the category of a given news
item through a UDT or similar. The idea would be to filter the search results
displayed in the search module's template and not before. This would enable
users of the modules to filter the news items as they wish.
      
avatar
Date: 2014-09-02 09:20
Posted By: Robert Campbell (calguy1000)

News module is intended to be a simple solution for most websites, not a
solution to everybody's different problems.   FEU is not a core module.

Best solution: fork the module and add the functionality that you want.
      
avatar
Date: 2014-09-04 14:18
Posted By: Leo Holsti (lholsti)

Update: after about a day of trying (and a night of sleeping) to make this work
somehow I thought of a simple solution.

Create a summary template in the news module, which only creates a smarty array
with the chosen information. In my case this was the id's of news items for
public access. So, something like this:

{foreach from=$items item=entry}
  {$publicnews[]=$entry->id}
{/foreach}

Then calls the news module in the beginning of your search template:
{news summarytemplate="show_in_search" category="public"}
and filter:

{if $entry->module == 'News' &&
$entry->modulerecord|in_array:$publicnews}
<li> {$entry->title} - <a
href="{$entry->url}">{$entry->urltxt}</a> ({$entry->weight}%)</li>
        {/if}

Hope this helps someone.


      
Updates

Updated: 2015-04-21 21:04
state: Open => Closed

Updated: 2014-09-02 09:20
resolution_id: => 8