Hi everyone !
I would to sort search results by differents ways.
Today, when I do a research in Pagesetter publications, publications are order by pubtype:asc and title:asc but I would like to choose how order my results.
For exemple I would like that first pubtype is TID 4, the second : TID 5, third : TID 26 etc...
and in the same time, I would like that PID from TID 4 are order by title and PID from other TID, ordered by publishDate:desc
I seek during a long time in template pagesetter_search_results.html how to do that but without result :(
Did anybody has ever tryed to do that or know how I can do it ?
Thanks a lot for your help !!!
edited by: Starguezer, Aug 07, 2007 - 05:50 PM
- craigh responded to »TagIt 3.0 for Zikula« 03:58 PM
- jmvaughn responded to »error when i try to upgrade to the last version of dizkus module (3.1)« 12:05 PM
- localrags responded to »Remove contents of nuke_sc_anticracker from Database« 11:30 AM
- jmvaughn responded to »Shoutit for zikula 1.3?« 09:31 AM
- mdee responded to »Different page content under one template (tpl file) based on URL« 07:17 AM
- espaan responded to »Categories disappear when editing ...« 08. Feb
- eledril responded to »How decrease zikula cpu usage« 08. Feb
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Pagesetter : order search results by...
-
- Rank: Softmore
- Registered: Mar 30, 2007
- Last visit: Nov 03, 2009
- Posts: 162
-
**unknown user**
- Rank: Helper
- Registered: Mar 16, 2002
- Last visit: May 18, 2010
- Posts: 985
You can make your own search templates if you want to, I did something similar a long time ago
http://www.pagesetter.net/index.php?module=Pagesetter&func=viewpub&tid=4&pid=63
to find the initial set-up
on www.filmfreak.be you can see more of that, on top [let's take the Dutch version] type in the search box e.g. 'Harry Potter', then a list will come up
TID1 = Biosreviews
TID8 = DVD Review
TID18 = Downloads
Otherwist I guess you'll have to hack pnsearch...
- Igor -
- Rank: Registered User
- Registered: Jun 09, 2002
- Last visit: Oct 21, 2009
- Posts: 12
You may also modify pnuserapi.php file.
Find:
ORDER BY $titleColumn";
and change to:
ORDER BY pg_publishDate DESC";
if you want to display titles descending by publish date. -
- Rank: Softmore
- Registered: Mar 30, 2007
- Last visit: Nov 03, 2009
- Posts: 162
Thanks Videokid !
I will try your solution soon, when I will have more time.
But if I understand well, I have to had same field's name in every TID if I whant to search in all TID no ?
Because I would like use the same search box to serach into news, products, Films details... but I haven't got the same field's name for every TID
Arthun : tanks for your answer but the problem is that I whant to order by publish date for some TID but by title for other... -
**unknown user**
- Rank: Helper
- Registered: Mar 16, 2002
- Last visit: May 18, 2010
- Posts: 985
Actually no, but it surely makes it easier... otherwise more pnvarcleanfrominput [or assign them to a string] will be in order.
Experience learned me not to make things more complicated as it is... If you have a field 'Text' for an actor, or for a movie, just use that for every TID, you only have to search in 'Text' for every TID.
You do have a lovely site!
- Igor -
- Rank: Softmore
- Registered: Mar 30, 2007
- Last visit: Nov 03, 2009
- Posts: 162
Ok, thanks for your help.
I've seen your site and I really like your search box. Is it possible that you send me it by mail with your template ? -
- Rank: Softmore
- Registered: Mar 30, 2007
- Last visit: Nov 03, 2009
- Posts: 162
I've found the solution !
It is not very nice but it works !
To display TID in good order, rename it like that :
"1 - Fiche de séries"
"2 - News"
"3 - Chroniques"
"others"
because results are ordered by TID title.
After, in pagesetter_search_results.htm (I don't remember the name file, I'm at work and I can't verify), do an "if else" to rename TID.
Something like that :
Code
<!-- [if results[tid] == 4]-- >
My TID Title
<!-- [elseif results[tid] == 5]-- >
My Other TID Title
<!-- [else] == 4]-- >
<!-- [results[title]]-- >
<!-- [/if]-- >
Code is not really that but the idea is here ;)
And after to order results by title:desc for tid 4 and by publishDate for others TID, do an other "if else" in pnuserapi.php file (at the bottom AFIR) where the is SQL request.
Code
if (tid == 4)
{
do SQL request and order results by
title:asc
}
else
{
do SQL request and order results by publishDate:desc
}
And that's ok !
If somebody whant more explication, don't hesitate to send me a PM ;)
But know I've got one more question :
How can I display online 5 first results of each TID and a link : "display all results of this TID" at the end of each TID group ?
for exemple, search result :
Quote
TID 4
- 1 result of tid 4
- 2 result of tid 4
- 3 result of tid 4
- 4 result of tid 4
- 5 result of tid 4
link : see other results of TID 4
TID 5
- 1 result of tid 5
- 2 result of tid 5
- 3 result of tid 5
- 4 result of tid 5
- 5 result of tid 5
link : see other results of TID 5
TID 6
- 1 result of tid 6
- 2 result of tid 6
- 3 result of tid 6
And the link return to a page with all result of the TID.
I'm not sure to be clear...
- Moderated by:
- Support
