215 Posts
iliil
8 years ago
11
Topic

Hello

I would like to use custom reordering feature for content type with object free. It doesn't work of course...there is no connection with a custom db table the free object uses but still...would anybody have a suggestion how to develop such as functionality with use of as much as possible from what already exist in seblod?

would be very useful...

Thanks

Michal

----

So far my custom db table contains  id and ordering columns  and I also have these custom  fields in the content type. I guess I'd have to create a custom plugin that will perform the reordering of my custom db table...

Get a VIP membership
4229 Posts
Kadministrator
8 years ago
0
Level 1

With id and ordering columns reordering should work, if you rby reorder feature had something like described in the manual in the mind:

215 Posts
iliil
8 years ago
0
Level 1

Hello Klas

Thanks For your answer. Let me please present my difficulties with free object reordering on a "currency content type".

This is a structure of the DB table #__obch_mena  (currency).

Here you can see the records

This is the list view of my search type for administration of currencies. The id and ordering fields have jGrid typography 

This is the Order by configuration

This is the storrage of mena_id field...

..and his is the storrage of mena_ordering field

The reordeing is actually enabled on the page..

..but the AJAX order save returns this error and the ordering is not stored

Eventually, I added the CCK ID field to my List View (right at the bottom)

After adding the CCK ID field, it's not dispayed at the seb_table template at all. With nor without the jGrid checkbox typography. That's really strange

The AJAX save order does't return any error but the ordering is not stored in the database so after refresh, the reordering is gone. Also the notice please that the POST parameters have changed

Would you please look at this and kindly try to suggest what am I doing wrong? If this works, it would be really amazing feature especially for such as small non-article objects e.g. currency

Thanks so much

Michal

4229 Posts
Kadministrator
8 years ago
0
Level 1

Hi,

please read linked manual (if you haven't already), I accidentally posted the other manual in my first post.

First you need to make search ordering work (as described in the manual), but with your mena_ordering field, not art_ordering. Also, remove cck_id field, you don't have cck_id when using free object, this is why it does not show. You need to use JGrid typography "checkbox" on mena_id field.

215 Posts
iliil
8 years ago
0
Level 1

Dear Klas

Thanks so much for your concern.

The changing of ordering using SEBLOD Search ordering field works.

Eventhough the url seems a bit odd to me:

index.php/sprava-men?cck=mena&search_mena_ordering=mena_ordering%3Adesc&boxchecked=0&search=app_mena&order[]=1&order[]=3&order[]=3&order[]=4&task=search

the search query seems ok

	SELECT t0.id AS pid,t0.pk AS pk,t0.pkb AS pkb,t0.parent_id AS 
parent,t0.author_id AS author,t0.cck AS cck,t0.storage_location AS 
loc,tt.id AS type_id,tt.alias AS type_alias
	
FROM `#__cck_core` AS t0
LEFT JOIN `#__obch_mena` AS t1 ON t1.id = t0.pk
LEFT JOIN `#__cck_core_types` AS tt ON tt.name = t0.cck
WHERE t0.cck = 'mena'
ORDER BY t1.ordering DESC

But as it comes to reordering feature, the ajax request still response the same error.

The saveOrderAjax rsponse says:

1103 - Incorrect table name '' SQL=SHOW FULL COLUMNS FROM ``

This is the source

cck=mena&search_mena_ordering=mena_ordering%3Adesc&boxchecked=0&search=app_mena&order%5B%5D=1&order%5B%5D=3&order%5B%5D=3&order%5B%5D=4&cid%5B%5D=4&cid%5B%5D=3&cid%5B%5D=2&cid%5B%5D=1

Any idea? 

Thanks again so much!!

Michal

4229 Posts
Kadministrator
8 years ago
6
Level 1

Hi,

I took a look at the code and it seems that free object is currently not supported - you would need to create an entry in cck_core table for each record from your table to be able to use reorder.

Why don't you just create new currency content type using article object? If you set storage names for field the same as you have in your table you will get the same table structure, just table name will be different. Then you can use all seblod functions without problem.

251 Posts
Viktor Iwan
8 years ago
5
Level 2

hi klas, please excuse me to jump into this discussion, but what do you mean about adding each record to cck core ? any tutorial or sample about this ?

4229 Posts
Kadministrator
8 years ago
4
Level 3

Hi Viktor,

there is no tutorial - cck_core is mother of all tables in seblod, it tells seblod where to look for data for each record - most important columns are pk (primary key in storage), pbk (primary key in optional second storage - e.g. for users this is com_content table when one is using bridge) and storage location. So for free object you would insert a record with those fields set to id_in_your_table, 0, free

41 Posts
jukov_b1
6 years ago
3
Level 4

I want to take an interest how the situation in a year after this discussion is? at me the same task and Artice will become the excess decision as both categories and data will turn into Article entity therefore selected a way of object:free 

1.tray also 


unfortunately reorder doesn't remain

2. I tried to deliver the cck_id field connected through left join in the form of filter

for the seblod 3.15 version this step has seemed to me excessive but I have added it

the same result is not present maintaining the sequence but also there is no cck_id field though in requests everything is OK and according to the recommendation of Klass the field is connected correctly?

prompt, it designates what object:free still where that is not considered? or I allow a lshibka in setup?

4229 Posts
Kadministrator
6 years ago
2
Level 5

From what I know ordering is not supported for object Free. Please don't hijack a year old posts.

41 Posts
jukov_b1
6 years ago
1
Level 6

Excuse me! 

Could you please tell me if adding and SEARCH JOIN and SEARCH QUERY and CCK_ID help to solve the problem of reordering from object FREE?

4229 Posts
Kadministrator
6 years ago
0
Level 7

Sorry, but I don't have that information.

Get a Book for SEBLOD