Forum

Please make sure that you have read the documentation and extensive resources provided on this site before posting your question!

Dynamic Content Gallery Resources

DCG Version 4.0 beta is now available for download and testing. This is a development version and not recommended for live sites. Read more here.

Note that the current stable release of the DCG is version 3.3.5.

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 3 characters - maximum search word length is 84 characters

Topic RSS
How to use a different Custom Field Value
Status: open
November 25, 2010
9:22 am
AndyA
Guest

Hey guys

Love the plugin but I am installing it on a site that already has a lot of images attached to each image using the Magic Fields plugin.

All of the existing images have a special custom field value and I was wondering if there was a way I could hack the plugin to read my custom field and use that instead of having to manually enter in the image url for each post.

Any help would be greatly appreciated

Thanks

Andy

November 25, 2010
8:53 pm
Ade
Admin
Forum Posts: 2493
Member Since:
August 25, 2008
Offline

Hi,

For forwards compatibility with the DCG, the best option is to write some code to transfer (or copy) all your Magic Fields image URLs to the DCG _dfcg-image postmeta field.

Alternatively, you will have to hack the DCG. If you're not using the latest version, upgrade to 3.3.3 (latest). Then find this in dynamic-content-gallery-plugin/includes/dfcg-gallery-core.php (line 513):

function dfcg_postmeta_info() {
global $dfcg_postmeta_upgrade;

if( $dfcg_postmeta_upgrade['upgraded'] == 'completed' ) {
$postmeta['desc'] = '_dfcg-desc';
$postmeta['image'] = '_dfcg-image';
$postmeta['exclude'] = '_dfcg-exclude';
$postmeta['link'] = '_dfcg-link';
$postmeta['link-window'] = '_dfcg-link-window';
} else {
$postmeta['desc'] = 'dfcg-desc';
$postmeta['image'] = 'dfcg-image';
$postmeta['exclude'] = 'dfcg-exclude';
$postmeta['link'] = 'dfcg-link';
}
return $postmeta;
}

You can then replace the DCG custom field keys (eg _dfcg-image) with yours. Obviously, you won't see these URLs in the relevant DCG Metaboxes.

Dynamic Content Gallery: Have you read the Configuration Guide and FAQ?
Forum Timezone: UTC 1

Most Users Ever Online: 28

Currently Online: theonsale, nloronacele
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

johnbroome: 13

speedyp: 12

sjpeaches: 12

CherylMcL: 10

gscorp: 8

lsnoei: 8

Member Stats:

Guest Posters: 770

Members: 1300

Moderators: 0

Admins: 1

Forum Stats:

Groups: 2

Forums: 7

Topics: 980

Posts: 4299

Newest Members: jochris26, eva-aa, Tushar, chargers3, jwhetstone, robert

Moderators:

Administrators: Ade (2493)