10 years ago
6
Topic
Hi

In many cases we need to build very special lists that must not only be ordered but grouped and summed.

For these cases we would need to set the SQL search query in the search form. Is it possible ?

For instance we need to display the total invoices per month and per year. the base content type is an invoice of course.

the result would look like:

2013: sum of jan invoices | sum of feb invoices | sum of mar invoices | sum of apr invoices | sum of may invoices | sum of jun invoices | ...
2014: sum of jan invoices | sum of feb invoices | sum of mar invoices | sum of apr invoices | sum of may invoices | sum of jun invoices | ...

Now we do the maths in the template itself but this is not the way it should be.

Thanks for your solutions

cyril



Get a Book for SEBLOD
10 years ago
1
Level 1
Hi

Since nobody seems to react, maybe I should be clearer:

In the previous versions of Seblod we could use the BEFORE RENDER code field to populate the fields in the the search form with pre computed SQL queries.

This way we could mimic some JOIN searches. However the new 3.2.2 version behaves differently and whatever you write in the before render code field is NOT taken into account!!

For example:
you have a search form with the ART_TITLE field and
a before render code field in which you write $fields['art_title']->value = "toto";

When you display your search form the ART_TITLE field is NOT filled with the value "toto"

With the 42 field we did't find either how to pre fill some fields with PHP/SQL code

If we are right, this would be a MAJOR flaw in the seablod search since it forces you to put all the custom queries in the template, after the seblod search.

So does someone know how to perform custom searches in the search tab ?

thanks

cyril

10 years ago
0
Level 2
Hi -- I was thinking of buying the Code Pack plugin (http://www.seblod.com/products/1854) for a project, but are you saying the Before Render feature currently doesn't work?
Thanks!
4229 Posts
Kadministrator
10 years ago
0
Level 1
Hi,

have you tried using this plugin http://www.seblod.com/products/1854 ? 
10 years ago
0
Level 1
Hi 

Of course, this is what I wrote ! The code field is no longer taken into account in a search form.

Now the code field is read AFTER the seach is performed!

cyril


10 years ago
0
Level 1
Hi again 

the answer was http://www.seblod.com/products/922 !!
10 years ago
0
Level 1
Hi

I come back to this topic because there are cases where there is MORE than a joint in the SQL query.

What is the right way to customize the search form with a custom SQL query ?

What we need is a SQL FIELD that will allow us to write our own query based on fields that we already put in the search form

for example you put :
  • field1
  • field2
  • field3
  • SQL field
and in the SQL field interface you write your own query with the aliases of field1, field2, field3


This way we really could have a full control on the seblod searches

thanks

cyril
Get a Book for SEBLOD