Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting preference is not taken into account when getting content by taxonomy #982

Closed
flrvt opened this issue Mar 9, 2014 · 7 comments
Closed

Comments

@flrvt
Copy link
Contributor

flrvt commented Mar 9, 2014

In Frontend.php on line 239 the getContentByTaxonomy() function is called including the parameter 'order' like so:

$content = $app['storage']->getContentByTaxonomy($taxonomytype, $slug, array('limit' => $amount, 'order' => $order, 'page' => $page));

In Storage.php this parameter is not taken into account and no sorting is done.

Not so familiar with the code, but this may fix it:

// line 1181
$order = $parameters['order'] ? : 'id ASC';
// line 1197
$query = "SELECT * FROM $tablename" . $where . " ORDER BY " . $order;
@bobdenotter
Copy link
Member

Thanks! Looks like you're right. And I think your assumptions about where the changes should go are spot on. Should I change this manually, or will you make a PR, for some github-karma? ;-)

@infodebrid
Copy link

Hi,

Not sure this what you are talking about, but we used

{% for related in relatedrecords|order('title')%}

Which is working pretty good

@bobdenotter
Copy link
Member

@infodebrid What you mention works fine on a separate page. What @flrvt means is an overview-page like /categories/movies. :-)

@flrvt
Copy link
Contributor Author

flrvt commented Mar 11, 2014

I was hesitant creating a pull request because I'm a rookie in Git ;). But give me a moment to figure it out, and i'll do it asap!

@bobdenotter
Copy link
Member

Sure! Check out this video, for a quick tutorial. Let me know if you get stuck, I'll gladly help! :-)

http://www.youtube.com/watch?v=YTbRzhQju4c

@GwendolenLynch
Copy link
Contributor

@flrvt I have done plenty of stupid Git stuff-ups lately... I am also here to help where I can (just another member a good community)

@flrvt
Copy link
Contributor Author

flrvt commented Mar 13, 2014

Pull request done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants