Limit output for Related Items module?
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.
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.
-
- Joomla! Fledgling
- Posts: 2
- Joined: Fri Sep 14, 2007 12:37 pm
- Contact:
Limit output for Related Items module?
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.
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.
-
- Joomla! Intern
- Posts: 57
- Joined: Mon Oct 22, 2007 2:19 am
- Location: U.S.A
- Contact:
Re: Limit output for Related Items module?
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?
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?
-
- Joomla! Intern
- Posts: 57
- Joined: Mon Oct 22, 2007 2:19 am
- Location: U.S.A
- Contact:
Re: Limit output for Related Items module?
I was able to figure this one out on my own
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........
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........
- coolnewmedia
- Joomla! Apprentice
- Posts: 47
- Joined: Wed Feb 13, 2008 6:43 pm
- Location: Victoria, BC
- Contact:
Re: Limit output for Related Items module?
Thanks for the fix. I too was looking for a way to limit related items.
Cheers!
Cheers!
"Web freelancer specializing in XHTML/CSS and web design. Currently learning Joomla 1.5."
http://www.coolnewmedia.com
http://www.coolnewmedia.com
-
- Joomla! Apprentice
- Posts: 16
- Joined: Fri Aug 11, 2006 10:19 am
- Location: Netherlands
- Contact:
Re: Limit output for Related Items module?
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
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.
- coolnewmedia
- Joomla! Apprentice
- Posts: 47
- Joined: Wed Feb 13, 2008 6:43 pm
- Location: Victoria, BC
- Contact:
Re: Limit output for Related Items module?
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
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
http://www.coolnewmedia.com
- MiracleMarc
- Joomla! Intern
- Posts: 50
- Joined: Tue Mar 07, 2006 12:42 pm
- Location: Hilversum, The Netherlands
- Contact:
Re: Limit output for Related Items module?
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/
- 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/
-
- Joomla! Fledgling
- Posts: 2
- Joined: Fri Aug 15, 2008 11:27 pm
Re: Limit output for Related Items module?
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...
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...
-
- Joomla! Fledgling
- Posts: 2
- Joined: Fri Aug 15, 2008 11:27 pm
related items - recently added first
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';
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';
- MiracleMarc
- Joomla! Intern
- Posts: 50
- Joined: Tue Mar 07, 2006 12:42 pm
- Location: Hilversum, The Netherlands
- Contact:
Re: Limit output for Related Items module?
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
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
-
- Joomla! Enthusiast
- Posts: 123
- Joined: Tue Apr 17, 2007 10:34 am
- Location: Durban, South Africa.
Re: Limit output for Related Items module?
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?
- MiracleMarc
- Joomla! Intern
- Posts: 50
- Joined: Tue Mar 07, 2006 12:42 pm
- Location: Hilversum, The Netherlands
- Contact:
Re: Limit output for Related Items module?
I will update the code, today end of day.
So no need to code yourself
So no need to code yourself
-
- Joomla! Enthusiast
- Posts: 123
- Joined: Tue Apr 17, 2007 10:34 am
- Location: Durban, South Africa.
Re: Limit output for Related Items module?
Superb. Let me know when...
Thanks again!
Thanks again!
- MiracleMarc
- Joomla! Intern
- Posts: 50
- Joined: Tue Mar 07, 2006 12:42 pm
- Location: Hilversum, The Netherlands
- Contact:
Re: Limit output for Related Items module?
It is there to download -> http://joomlacode.org/gf/project/relatedanything/
-
- Joomla! Enthusiast
- Posts: 123
- Joined: Tue Apr 17, 2007 10:34 am
- Location: Durban, South Africa.
Re: Limit output for Related Items module?
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.
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.
-
- Joomla! Intern
- Posts: 51
- Joined: Thu Jan 03, 2008 12:06 pm
search in specific Cat/Sec for Related Items | Sorry... J!1.
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!!! !!!
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!!! !!!
- dextercowley
- Joomla! Virtuoso
- Posts: 3286
- Joined: Sun Apr 06, 2008 4:44 am
- Location: Seattle, WA, USA
Re: Limit output for Related Items module?
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
Hope this helps. Mark
Mark Dexter
"Well...how did I get here?"
"Well...how did I get here?"
-
- Joomla! Intern
- Posts: 51
- Joined: Thu Jan 03, 2008 12:06 pm
Re: Limit output for Related Items module?
Some time ago ;-)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
Thank you for the link... this project seems to evolve in the right direction!
Now even with component and new options.
CU
- sn00ze
- Joomla! Apprentice
- Posts: 27
- Joined: Wed Jul 15, 2009 11:01 am
- Contact:
Re: Limit output for Related Items module?
great module.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
thanks for the heads up