Forum Replies Created
-
AuthorPosts
-
October 3, 2023 at 7:51 PM in reply to: Linking Two Custom Post Types in select/dropdown field #43420
leebazCDS
ParticipantHi Peter,
Thanks! My query isn't regarding the front-end output, but rather when inputing data into the custom fields. I used Customer and Order as examples, but I'll refer to my exact use case so as to be more clear:
We install MET masts for weather monitoring. So I have a custom post type 'masts' and custom fields for the mast properties, such as location, height, data of installation etc.
We have various customers and each customer may have one or more contact for a particular mast. So I have a custom post type 'Customer' and custom fields for the customer including the various contacts.
When creating a mast I populate the 'Customer' field using the 'post' field type.
Then for the customer contacts, I want to make a selectable list of the contacts particular to the selected customer.
Is that possible within the field builder plug in, or would I need a custom function elsewhere?
October 2, 2023 at 10:50 PM in reply to: Linking Two Custom Post Types in select/dropdown field #43415leebazCDS
Participanthi, the 'post' field is great! Is it possible to then select a saved field from within the post type.
Example:
1st Custom post type: Companies, has Custom Fields for contacts Name, email, Phone of various company contacts.
Customer 1: Nike
Contacts: Bill, Susan, Jimmy, Jane
Customer 2: Adidas
Contacts: Adrian, Khaled2nd Custom post type: Orders, which has custom field dropdown for 'Customer' using from the 'post' select choosing from Customers, then which contact details for that Customer? I want to select A number of the contacts so that I can then display which contacts are relevant for that Order.
Hope that makes sense!
Thanks!leebazCDS
ParticipantHi - I have made this work, but not exactly how described in the examples, so I thought I'd share just in case.
Since I only want one image i've used the 'single image' upload meta.
I found that this would output the image ID, so I used the following code to retreive and output it:
$highlights = rwmb_meta( 'overview_rhs_highlights' ); if ( ! empty( $highlights ) ) { foreach ( $highlights as $highlight ) { echo '<div class="col-md-12"><div class="d-row">'; $imageid = $highlight['overview_rhs_highlights_image']; $image = wp_get_attachment_image_src( $attachment_id = $imageid ); echo '<div class="icon"><img class="img-fluid" src="', $image[0], '"></div>'; echo '<div class="text-group">'; echo '<h4>'.$highlight['overview_rhs_highlights_title'].'</h4>'; echo '<p>'.$highlight['overview_rhs_highlights_text'].'</p>'; echo '</div></div></div>'; } }leebazCDS
ParticipantThanks - I'll give that a go too!
leebazCDS
ParticipantHi,
Thanks for getting back to me.
Is there a problem with uploading SVG files as a file, not as an image?
When I try with a PDF or an image, it appears to work fine. But When i try with an SVG it doesn't. -
AuthorPosts