Limit output for Related Items module?

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
virushead
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Sep 14, 2007 12:37 pm
Contact:

Limit output for Related Items module?

Post by virushead » Mon Oct 22, 2007 12:57 pm

I'm using the Related Items module and in some cases I'm getting way too many related posts listed in the menu.

Does anyone know a way to put a limit on how many items that it can display? I really don't want more than 7-10.  ???

Any suggestions would be appreciated - thanks.
Last edited by virushead on Mon Oct 22, 2007 12:58 pm, edited 1 time in total.

psgeeks
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Mon Oct 22, 2007 2:19 am
Location: U.S.A
Contact:

Re: Limit output for Related Items module?

Post by psgeeks » Thu Nov 29, 2007 4:14 pm

This is what i'm looking for also  ??? - can any one please help?

I know we can't pass a parameter, I've looked, but i might be wrong. But can we hack the code to accomplish this?
http://www.PeopleSoftGeeks.com

Life can only be understood backwards but it must be lived forwards.

psgeeks
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Mon Oct 22, 2007 2:19 am
Location: U.S.A
Contact:

Re: Limit output for Related Items module?

Post by psgeeks » Fri Nov 30, 2007 1:41 am

I was able to figure this one out on my own  :pop

If have posted what i've done on my website so others can benefit from it just follow the link below

http://www.peoplesoftgeeks.com/joomla-t ... oomla.html

Later guys........
http://www.PeopleSoftGeeks.com

Life can only be understood backwards but it must be lived forwards.

User avatar
coolnewmedia
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Wed Feb 13, 2008 6:43 pm
Location: Victoria, BC
Contact:

Re: Limit output for Related Items module?

Post by coolnewmedia » Fri Jun 27, 2008 7:27 pm

Thanks for the fix. I too was looking for a way to limit related items.
Cheers!
"Web freelancer specializing in XHTML/CSS and web design. Currently learning Joomla 1.5."
http://www.coolnewmedia.com

xiphias
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Fri Aug 11, 2006 10:19 am
Location: Netherlands
Contact:

Re: Limit output for Related Items module?

Post by xiphias » Mon Jul 07, 2008 7:12 am

Nice fix but I think I have just created one which works better performance wise because it only gets the desired number of articles from the database. The posted fix seems to get a query with 100 records and only limiting the number processed. It's also less to change ;-)

The fix I just created is also configurable from the administrator.

Backup \modules\mod_related_items.php and \modules\mod_related_items.xml

1. Open \modules\mod_related_items.php
2. Look for (line 17)
global $mosConfig_offset, $option, $task;
3. Below add
$count = intval( $params->get( 'count', 10 ) );
4. Find (line 59)
$database->setQuery( $query );
5. Replace with
$database->setQuery( $query, 0, $count );
6. Open \modules\mod_related_items.xml
7. Look for (line 21)
8. Above add
<param name="count" type="text" default="10" label="Count" description="The number of items to display (default 10)" />

Save and upload and configure from the modules administrator.

The way I came up with this fix is by looking how the latest items module was limited and applied the same to the related items module.

You can see this in action on http://www.sportfotografie.us in any content item (lees meer). It's the top module on the right called 'Gerelateerde items'.

Enjoy
You do not have the required permissions to view the files attached to this post.

User avatar
coolnewmedia
Joomla! Apprentice
Joomla! Apprentice
Posts: 47
Joined: Wed Feb 13, 2008 6:43 pm
Location: Victoria, BC
Contact:

Re: Limit output for Related Items module?

Post by coolnewmedia » Tue Jul 08, 2008 4:20 pm

Hi Xiphias,

You're solution is for Joomla 1.0.x and we're looking for a solution for Joomla 1.5.x As time permits, I look at your code and see if I can take your 1.0 example and port it to 1.5 (if possible--unfortnately I'm not the strongest coder.) Also I see if it's been proposed as a feature request.

Cheers,

Kevin
"Web freelancer specializing in XHTML/CSS and web design. Currently learning Joomla 1.5."
http://www.coolnewmedia.com

User avatar
MiracleMarc
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Tue Mar 07, 2006 12:42 pm
Location: Hilversum, The Netherlands
Contact:

Re: Limit output for Related Items module?

Post by MiracleMarc » Fri Aug 01, 2008 3:48 pm

I developed some enhanchement to the orginal Related Items module for J1.5

- limit items
- include/exclude sections
- include/exclude categories

Still working on more options, like "show related from current section only"

Check out at http://joomlacode.org/gf/project/relatedanything/

schowalye
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Aug 15, 2008 11:27 pm

Re: Limit output for Related Items module?

Post by schowalye » Fri Aug 15, 2008 11:46 pm

Thanks for the related anything module. I works for limiting the number and category.

I was looking desperately for a different option also. To show recently added articles. In other words to reverse the article order to show the latest articles at the top.
For example I want to show 15 latest related articles to the page.

Verr much appreciated if there is a solution...

schowalye
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Aug 15, 2008 11:27 pm

related items - recently added first

Post by schowalye » Mon Aug 25, 2008 6:24 am

Find a solution for date order in MiracleMarc's related anything module.
In the helper.php file, you should change the line (155) as below.
Then it reversed the order to show recently added ones first.

' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )';

to

' AND ( a.publish_down = '.$db->Quote($nullDate).' OR a.publish_down >= '.$db->Quote($now).' )' .
' ORDER BY a.created DESC';

User avatar
MiracleMarc
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Tue Mar 07, 2006 12:42 pm
Location: Hilversum, The Netherlands
Contact:

Re: Limit output for Related Items module?

Post by MiracleMarc » Mon Aug 25, 2008 9:07 am

Yes, that is totally correct. Thanks for this feature.

In the next release I will add this as an option in the module, so you can choose between: order by latest, order by olderst, order by most relevant, etc.

Thank you,
Marco

crashtackle
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 123
Joined: Tue Apr 17, 2007 10:34 am
Location: Durban, South Africa.

Re: Limit output for Related Items module?

Post by crashtackle » Tue Sep 09, 2008 1:08 pm

Thanks PSGeeks, I tried to adjust the helper.php, but I just get an error on line 116...must be said that I by no means a coder :'( - I just cut and paste, but clearly I am doing something wrong. any chance you could upload the adjusted helper.php file as a whole?

User avatar
MiracleMarc
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Tue Mar 07, 2006 12:42 pm
Location: Hilversum, The Netherlands
Contact:

Re: Limit output for Related Items module?

Post by MiracleMarc » Tue Sep 09, 2008 2:00 pm

I will update the code, today end of day.
So no need to code yourself ;)

crashtackle
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 123
Joined: Tue Apr 17, 2007 10:34 am
Location: Durban, South Africa.

Re: Limit output for Related Items module?

Post by crashtackle » Tue Sep 09, 2008 2:22 pm

Superb. Let me know when...

Thanks again!

User avatar
MiracleMarc
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Tue Mar 07, 2006 12:42 pm
Location: Hilversum, The Netherlands
Contact:

Re: Limit output for Related Items module?

Post by MiracleMarc » Thu Sep 11, 2008 5:54 pm


crashtackle
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 123
Joined: Tue Apr 17, 2007 10:34 am
Location: Durban, South Africa.

Re: Limit output for Related Items module?

Post by crashtackle » Fri Sep 12, 2008 5:57 am

Fantastic! Thanks.

A nice feature may be a negative keyword option? For example I have a site that is about a rugby board game. The keywords board game, and rugby appear often, but I don't want the articles to relate on those words as every article would show up.

If you could assign a negative keyword list to ignore those 'site generic' terms it would be great. It's a feature I would find useful - but maybe not so useful for others...

Thanks again.

rexkramer
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu Jan 03, 2008 12:06 pm

search in specific Cat/Sec for Related Items | Sorry... J!1.

Post by rexkramer » Fri Sep 12, 2008 3:16 pm

Sorry for asking... ;-)
But i would really need your great advanced related Module for J!1.0x ! I know the only alternative "Related XTD" is not exactly what i needed. Though it is really rich on features and.

If i read it right, your module is able to limit the search in specific Cat/Sec...
I need a relation from the current article to articles from OTHER categories or sections – IMHO a must have. But there seems no solution or requests for this alternative way?!?

Can you adapt your module to J!1.0 ?
Please!!!
TIA!!! !!!

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: Limit output for Related Items module?

Post by dextercowley » Wed Oct 08, 2008 9:33 pm

Hi. Here is a link to a new, free related items extension that might help: http://joomlacode.org/gf/project/freejoomla/wiki/.

Hope this helps. Mark
Mark Dexter
"Well...how did I get here?"

rexkramer
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu Jan 03, 2008 12:06 pm

Re: Limit output for Related Items module?

Post by rexkramer » Wed Dec 31, 2008 12:22 am

dextercowley wrote:Hi. Here is a link to a new, free related items extension that might help: http://joomlacode.org/gf/project/freejoomla/wiki/.

Hope this helps. Mark
Some time ago ;-)
Thank you for the link... this project seems to evolve in the right direction!
Now even with component and new options.
CU

User avatar
sn00ze
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Wed Jul 15, 2009 11:01 am
Contact:

Re: Limit output for Related Items module?

Post by sn00ze » Fri Apr 02, 2010 8:16 pm

dextercowley wrote:Hi. Here is a link to a new, free related items extension that might help: http://joomlacode.org/gf/project/freejoomla/wiki/.

Hope this helps. Mark
great module.
thanks for the heads up


Locked

Return to “Extensions for Joomla! 1.5”