Dynamic reordering ?

More
10 years 5 months ago - 10 years 5 months ago #56287 by nowid50
Dynamic reordering ? was created by nowid50
Hello,

I am wondering if Flexicontent can order according to some submitted sql.
For instance, I have a field that contains GPS location for an item and I would like to be able to order the items according to the user location so that they can have the closest item they want.
I know the sql code to compute the metric distance between 2 GPS points but I don't know where to put it.

Can someone help me ?
Last edit: 10 years 5 months ago by nowid50.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago - 10 years 5 months ago #56290 by micker
Replied by micker on topic Dynamic reordering ?
you need a pro dev for a plugin for this ....

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]
Last edit: 10 years 5 months ago by micker.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #56299 by ggppdk
Replied by ggppdk on topic Dynamic reordering ?
Hello

is it a text field ?

there is not an option for custom SQL code for ordering,
to do that would probably need:
- parameter for ORDER BY clause
- parameter of custom JOIN clauses
- parameter for an "AND" clause to append to the WHERE clause

possible but not implemented


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago - 10 years 5 months ago #56379 by nowid50
Replied by nowid50 on topic Dynamic reordering ?
I am actually a developper.

The field is custom made by me, it allows the user to place a marker directly on a google map.

I already more or less done it for a client through a custom module. (You can see it at www.ot-dreux.fr/ by using a mobile)

But it is "emulated" because there is a custom query that find and sort items' ids according to position and distance. Those id are used to load the data and render it with templating.

I would like to have it working for components view without "hacking" something. Too bad it is not possible yet.
Last edit: 10 years 5 months ago by nowid50.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #56785 by nowid50
Replied by nowid50 on topic Dynamic reordering ?
I'm upping this topic because I'm going to need this very soon.

I'm going to hack the core but I would like to have a cleaner way to do dynamic reordering.

Thanks in advance :)

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #56793 by ggppdk
Replied by ggppdk on topic Dynamic reordering ?
Hello

so you want to add
- custom join
- custom AND clause for WHERE
- custom ORDER clause

to category view and to universal content module


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago - 10 years 5 months ago #56799 by nowid50
Replied by nowid50 on topic Dynamic reordering ?
Yes this is exactly what I need. The best would be to be able to use a joomla query object but I don't know if you use it in the component's models.

There is also a good help with what I want to do with this document .

I don't know how to cleanly achieve this. Maybe by using plugins events in the fields files ?
Last edit: 10 years 5 months ago by nowid50.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago - 10 years 5 months ago #56800 by ggppdk
Replied by ggppdk on topic Dynamic reordering ?
Code:
The best would be to be able to use a joomla query object but I don't know if you use it in the component's models.

using joomla query object , makes little difference in our case,
unless you would extend and then override the category model,

and it would make little difference, because:
-- overriding the model CLASS would mean that you can override the methods too, aka the query building method

- and if we add parameters for these clauses, it would not make difference how the clauses are added to the query
- even then if we add methods to the model to add joins, order, etc clauses
the model is created inside view.html.php file which is not overridable


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 10 years 5 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago #56811 by ggppdk
Replied by ggppdk on topic Dynamic reordering ?
Hello

about Joomla query object, it is used in 10% of FLEXIcontent queries, the rest set an SQL string

about adding parameters to allow
-1- extra select columns
-2- extra join clauses
-3- custom order clause
-4- additional AND-WHERE

i think we can add them, it would be the responsibilty of the developer not to break the query,

but for performance reason we use 2 queries,
- get the item ids (which will use 2,3,4 of the above clauses)
- then get item data (which will use 1,2 of the above clauses)

even if a query gets broken Joomla debug will print it and you can correct, so no need to give more info for the query


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
10 years 5 months ago - 10 years 5 months ago #56812 by ggppdk
Replied by ggppdk on topic Dynamic reordering ?
What about this:

docs.joomla.org/How_to_override_the_comp...rom_the_Joomla!_core

it seems that you can override the category model
(create a class to extend the FLEXIcontent category model)
and then you will "only" modify the query building


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 10 years 5 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save