Forums

NextGEN Custom Fields
get custom field in NextGEN widget (3 posts)

  1. gkrnours
    Member
    Posted 9 months ago #

    I'm using NextGEN Gallery 1.8.3 and NextGen Custom Field 1.1.2

    I've added a field "link", and try to display it in the ngg widget.
    But from what I can see, the widget is build using js, and loading data through json. And the json seems to have no information on custom field, only about standard field.

    update
    I've spend one more hour searching and trying stuff before posting, and I've get get thing together. It's dirty crap, but it's getting the job done.

    In order to get get my custom data in the json, I've add an outer join to the get_gallery function, in ngg_db.php, which get data from custom field and concat everything. I end up with `SELECT SQL_CALC_FOUND_ROWS tt.*, t.*, l.pid, l.field_value AS link
    FROM $wpdb->nggallery AS t
    INNER JOIN $wpdb->nggpictures AS tt
    ON t.gid = tt.galleryid
    LEFT OUTER JOIN ".$pre."nggcf_field_values AS l
    ON tt.pid = l.pid
    WHERE t.gid = %d {$exclude_clause}
    ORDER BY tt.{$order_by} {$order_dir} {$limit_by}"`. I'm pretty sure thing will simply break if I add a second custom field, but right now, thing work.

  2. shauno
    Member
    Posted 9 months ago #

    Hey

    As you found out, NGG doesn't provide places to hook into all its output functions.
    Nicely done on figuring it out and making it work for you. That's a skill a lot of people seem to lack :)

  3. Bafff.ru
    Member
    Posted 8 months ago #

    please can you help me to integrate NGG custom field (link to the post) and the NGG images that opened via Easy FancuBox modal window?

Reply

You must log in to post.

About this Plugin

About this Topic