• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: [SOLVED ]Additional functionality to News & Search
PostPosted: Wed Sep 30, 2009 2:05 pm 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 872
Location: London
Hi I need some additional functionality to the news and search.

For News I need a most read articles option so on the front end I can have a content block and just put in a tag to show say the most 5 popular news articles. The system would have to be able to set the date range in which to search for this i.e. 30 days. Ideally this would not have to effect the core news module or if it does in a minimal way which is easy to incorporate into updates to CMSMS.

For search I need to ability to have a drop down menu pre-populated with all categories (probably just top level categories) and for the the keyword search to only search the chosen category.

_________________


Website Design & Production
http://www.applejack.co.uk


Last edited by applejack on Thu Oct 01, 2009 4:22 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Additional functionality to News & Search
PostPosted: Thu Oct 01, 2009 3:20 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 6609
Location: Fernie British Columbia, Canada
The HitCounter could be expanded to have the ability to return results within a specified amount of days (right now it's a very simple module)...  so something like
{HitCounter action=getmostvisited ndays=30 key1=news assign='theidlist'}
could return a list of news article id's.... which you could then use a foreach loop to call the news on.
like:
{foreach from=theidlist item=oneid}
  {News action=detail articleid=$oneid detailtemplate=short_details}
{/foreach}

As far as search goes....  that's a two step process:

the action=browsecat can generate a list of categories (may have to add a slight tweak this to only show top level categories).... after that it's trivial to put the results in a dropdown with some javascript/jquery to grab the dropdown value and add it to the form.

Currently the search module indexes ALL news articles, and then calls the News module to gather the information (title and link) for display.  so what would be required is a way to hide the results based on wether the category of the news article was in the selected category, or one of its children.  We would need to pass the desired category, and possibly an 'allowchildren' flag to the news module for when it's returning results.This would require a simple modification to the News module to allow accepting 'passthru' parameters, and how to handle them.  i.e you would call Search like:

{Search passthru_News_category='blah' passthru_News_allowchildren='1'}

The passthru_News_category becomes a hidden input field in the form, jquery/javascript can update that field based on the selected value in the dropdown.

These are all very simple modifications, which are then re-usable by any website...

_________________
Follow me on twitter
--
if you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
----------------
Don't make me angry..... you won't like me when I'm angry....


Top
 Profile  
 
 Post subject: Re: Additional functionality to News & Search
PostPosted: Thu Oct 01, 2009 4:22 pm 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 872
Location: London
Hi Robert

Thanks as always, your a star.

_________________


Website Design & Production
http://www.applejack.co.uk


Top
 Profile  
 
 Post subject: Re: [SOLVED ]Additional functionality to News & Search
PostPosted: Fri Oct 02, 2009 11:39 am 
Offline
Forum Members
Forum Members

Joined: Sat Jun 10, 2006 5:34 pm
Posts: 38
Hi. I'm looking for the dropdown search function in search module as well but I know very little php/jquery. Is there somewhere I can get a fuller explanation? Thanks.  ???


Top
 Profile  
 
 Post subject: Re: [SOLVED ]Additional functionality to News & Search
PostPosted: Thu Oct 15, 2009 2:39 pm 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 872
Location: London
Hi Loopy

No as I haven't needed to do it yet. You need to use Javascript to do it though. I am not 100% sure about how to do this so I would post another message to the Forum as I am sure it has been done many time before. I would really appreciate it if you could let me know if you find a solution.

_________________


Website Design & Production
http://www.applejack.co.uk


Top
 Profile  
 
 Post subject: Re: [SOLVED ]Additional functionality to News & Search
PostPosted: Fri Nov 06, 2009 5:21 pm 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 872
Location: London
Hi Loopy

Did you manage to sort this out? If not then I will be doing a site shortly which needs this functionality with the news category select option. I should be able to do most of this myself though may need Calguy's or someone else's help with mod of the News module if it is needed.

_________________


Website Design & Production
http://www.applejack.co.uk


Top
 Profile  
 
 Post subject: Re: Additional functionality to News & Search
PostPosted: Wed Jan 11, 2012 1:38 pm 
Offline
Power Poster
Power Poster

Joined: Fri Oct 20, 2006 12:07 pm
Posts: 417
calguy1000 wrote:
the action=browsecat can generate a list of categories (may have to add a slight tweak this to only show top level categories).... after that it's trivial to put the results in a dropdown with some javascript/jquery to grab the dropdown value and add it to the form.

Currently the search module indexes ALL news articles, and then calls the News module to gather the information (title and link) for display. so what would be required is a way to hide the results based on wether the category of the news article was in the selected category, or one of its children. We would need to pass the desired category, and possibly an 'allowchildren' flag to the news module for when it's returning results.This would require a simple modification to the News module to allow accepting 'passthru' parameters, and how to handle them. i.e you would call Search like:

{Search passthru_News_category='blah' passthru_News_allowchildren='1'}

The passthru_News_category becomes a hidden input field in the form, jquery/javascript can update that field based on the selected value in the dropdown.

I think I get step two, but how to use step one?
I too want to be able to search only a certain news catagory... anyone solved this yet?


Top
 Profile  
 
 Post subject: Re: [SOLVED ]Additional functionality to News & Search
PostPosted: Wed Jan 11, 2012 2:03 pm 
Offline
Power Poster
Power Poster

Joined: Fri Mar 30, 2007 2:28 am
Posts: 872
Location: London
The passthru search results function isn't written as far as I know. Are you wanting this for the News module or CGBlog. I have a specially written function for the CGBlogs module and there are also bugs in the Search module which need correcting before you can get this to work.

For an example please see http://www.commercialriskeurope.com

If you are interested in commercial support for this then pm me.


Top
 Profile  
 
 Post subject: Re: [SOLVED ]Additional functionality to News & Search
PostPosted: Sun Jun 17, 2012 4:44 pm 
Offline
New Member

Joined: Sun Jun 17, 2012 4:40 pm
Posts: 2
Hi,
I didn`t tried yet but I guess this can be done using only css3 (if you're looking for a mouse over event). I also need to make a dropdown for categories menu, I`ll check it out and reply here later.


Top
 Profile  
 
 Post subject: Re: [SOLVED ]Additional functionality to News & Search
PostPosted: Sun Jul 08, 2012 4:48 am 
Offline
Forum Members
Forum Members

Joined: Mon Mar 14, 2011 1:16 am
Posts: 182
Location: Brisbane, Australia
It'd be great if the Search module was enhanced to allow some of this stuff to be automated. For example:

* Which module(s) it will search by default
* Whether users can choose which modules to search (overriding the default options)
* The name to display for each module in the search results
* Whether an Advanced Search link/page is offered
* Any particular URLs/pages to ignore

Each module could then plug into this further by allowing module-specific options. In the case of the News module, within the Search module you'd have a section 'News module options' which provides further options such as 'Category search available', and so on.


Top
 Profile  
 
 Post subject: Re: [SOLVED ]Additional functionality to News & Search
PostPosted: Fri Jul 13, 2012 10:35 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 22, 2005 11:19 am
Posts: 305
Until the passthru param is implemented, you may like to play with my template based solution.


viewtopic.php?f=4&t=61947


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting