×
Please submit new Bug Reports on GitHub: github.com/Jensen-Technologies/component-creator-issues/issues
How to change frontend default sort criteria
Jason Cooper
Nouveau membre
Posts: 1
il y a 6 ans 8 mois #1766
par Jason Cooper
How to change frontend default sort criteria a été créé par Jason Cooper
Hi everyone
Could someone kindly tell me how to change the frontend default sort criteria from 'ordering' to something else, for example, 'firstname' please?
So far, I've changed the frontend model to this:
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'firstname');
$orderDirn = $this->state->get('list.direction', 'asc');
This works but I want to make sure I've done it correctly.
Many thanks.
Could someone kindly tell me how to change the frontend default sort criteria from 'ordering' to something else, for example, 'firstname' please?
So far, I've changed the frontend model to this:
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'firstname');
$orderDirn = $this->state->get('list.direction', 'asc');
This works but I want to make sure I've done it correctly.
Many thanks.
Connexion ou Créer un compte pour participer à la conversation.
David Vargas
Nouveau membre
Posts: 17
il y a 6 ans 7 mois #1777
par David Vargas
Réponse de David Vargas sur le sujet How to change frontend default sort criteria
Hi, Jason!
It is totally correct, as long as the Front-End gets the ordering criteria from the Back-End.
Kind regards,
David.
It is totally correct, as long as the Front-End gets the ordering criteria from the Back-End.
Kind regards,
David.
Connexion ou Créer un compte pour participer à la conversation.
Temps de génération de la page : 0.051 secondes