9 years ago
2
Topic

Hi,
Is it possible to retrieve a list of CCK items programmatically? I am trying to create a custom form with tabs with lists of counties and cities, and I think it would be easiest to get it to work the way I want if I could just query all the counties/cities and get the results as a PHP array.

I am currently looking at the onContentSearch event since it looks like that's how Seblod queries and prepares search results, but the code is hard to follow and I haven't found any documentation on the Seblod API...

Thanks for any ideas,
Matt

Get a Book for SEBLOD
9 years ago
1
Level 1

Hello mbrowne,

welcome on SEBLOD forum.

If I well understand, you want to display some datas in a form view ?

if datas are only to be displayed as text, you can do like that :

  1. Add a empty freetext field (for example named "my_countries")
  2. use a field code "Beforerender" to change the "form" property of the previous field, in the $fields array. ( $fields['my_countries']->form = $countries; )

regards.

Lionel

9 years ago
0
Level 2

Hi,
Thank you for the info, but I don't think a freetext field will work, since my main content type (contact_center) has a many-to-many relationship with counties and cities. The counties and cities are already all entered into the database using their own content types.

I am thinking it may be easiest just to query the database directly...since I only need a list of county or city names and not any other fields, I think I could just join the #__content table with the #__cck_core table with the condition that the 'cck' column must have a value of 'county' or 'city'.

But it would be nice to do this using the Seblod API if there's a reasonably simple way of doing so. This is the biggest thing I'm missing with Seblod so far as compared to Drupal's CCK - the lack of a clearly documented API. I realize that creating a programmer-friendly API would take time but I'm sure many web developers such as myself would find it very valuable.

Thanks,
Matt

Get a VIP membership