next entry sort just like next page sort

Get help with installation and running PivotX 2.0.x here. Please do not post Extension or Theme related questions here.

next entry sort just like next page sort

Postby winters » Fri Jun 26, 2015 9:30 pm

does someone know if there is a way to use next (and prev) entry but sort them on title just like next page the option has (http://book.pivotx.net/page/app-b#anchor-nextpage)?

thanks!
winters
winters
 
Posts: 82
Joined: Thu Jan 13, 2011 9:09 pm

Re: next entry sort just like next page sort

Postby Harm10 » Sat Jun 27, 2015 8:34 pm

The next and previous options for entries are dependent on the sort order you are displaying them in.
You can view entries through archive display, category display and weblog display.
I assume you want to use this in the weblog display.
Then you should order this weblog by title. You should be able to use the orderby http://book.pivotx.net/index.php?page=app-b#anchor-subweblog--weblog in the template you are using to display the weblog.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: next entry sort just like next page sort

Postby winters » Sat Jun 27, 2015 8:52 pm

thanks for the info harm

this will be used on an entry. so is it correct that when you setup the weblog with a sort on title this
will influence the entry from the weblog and so the next (prev.) entry

better I will just try and report back

thanks
winters
winters
 
Posts: 82
Joined: Thu Jan 13, 2011 9:09 pm

Re: next entry sort just like next page sort

Postby winters » Wed Jul 01, 2015 4:22 pm

No matter what I try I do not get the result I want, the next en prev entry sorting on title

Could there be something I am overlooking?

thanks
winters
winters
 
Posts: 82
Joined: Thu Jan 13, 2011 9:09 pm

Re: next entry sort just like next page sort

Postby Harm10 » Wed Jul 01, 2015 7:59 pm

You are right. It doesn't work. Setting up a weblog sorting on title is easy but as long as you stay on front page or archive the titles are sorted.
As soon as you display an entry in detail the prev/next links are the "normal" ones.
I have to investigate this further. But right now it is just too hot for that.......................... :oops:
So I will come back and try to solve this for you.
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: next entry sort just like next page sort

Postby winters » Thu Jul 02, 2015 6:21 pm

thanks harm!
winters
winters
 
Posts: 82
Joined: Thu Jan 13, 2011 9:09 pm

Re: next entry sort just like next page sort

Postby winters » Fri Jul 03, 2015 7:48 pm

Hi harm

I did some searching but can't seem to find where (In witch file) this is taken care of?

do you know witch file that is?

thanks again,
willem
winters
 
Posts: 82
Joined: Thu Jan 13, 2011 9:09 pm

Re: next entry sort just like next page sort

Postby Harm10 » Sat Jul 04, 2015 8:23 am

Most of the tags coming with PivotX itself are located in modules/module_smarty.php.
I have taken a brief look and the entry implementation does not accept a sort parm.
As there are 2 implementations needed for flat file and sql the routine points to get_next_code (same folder in entries_flat.php and entries_sql.php).
As you can see there currently only date is used to decide what is the next entry.
You maybe already know this but development of PivotX has long stopped. We only do error fixing now.
You could try to fiddle around yourself with this code but as it is core code it could be replaced in future by an error fix.

Another option could be to code a weblog in the smarty theme template for the entry with exactly the same specifications, go through this entire weblog and create an array for all entries, pick out your current entry and use the previous and next occurence in the array to create prev/next links from.
Quite some code for experts............... ;)
Quality is in the detail of things............

Want to change or update your PivotX site? Mail or PM me!
I can also convert your site to a Wordpress site!
Harm10
Developer
 
Posts: 2010
Joined: Wed Jun 17, 2009 9:37 am
Location: Somewhere in The Netherlands (aka Holland)

Re: next entry sort just like next page sort

Postby hansfn » Fri Jul 17, 2015 11:20 pm

OK, the reason nextentry and previousentry only works for sorting by date is that, well, it's a blog: "[website] consisting of discrete entries ("posts") typically displayed in reverse chronological order". Not very helpful, but at least it's an explanation.

Harm's suggestion, "code a weblog in the smarty theme template for the entry with exactly the same specifications, go through this entire weblog [...]", is actually much easier than it seems, but I don't have time to write that smarty code for free - sorry.
hansfn
Developer
 
Posts: 3278
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: next entry sort just like next page sort

Postby sarwanov » Mon Oct 26, 2015 7:01 am

I am strongly agree with Harm10's idea and thoughts and I appreciate his efforts.
Graduated from Soran University with First Class Degree with Honours in Computer Science.
sarwanov
 
Posts: 1
Joined: Wed Oct 21, 2015 7:12 am


Return to 2.x Support Forum

Who is online

Users browsing this forum: No registered users and 2 guests

cron