alexadark
Forum Replies Created
-
Forum: Plugins
In reply to: [Carbon Fields] Hiding fields to the clienti just comment them, so i can reactivate them if needed
Forum: Plugins
In reply to: [Carbon Fields] Hiding fields to the clientIt works, that’s smart ??
thank you!Forum: Plugins
In reply to: [Carbon Fields] fields closed by defaultso it would be nice to have the option to have that by default https://webstantly.com/cfclosed.png instead of open
and then the ability to choose tabbed or notof course i will update when it will be merged
This is a work in progress too, a personal project to build sites quickly with it ??
Forum: Plugins
In reply to: [Carbon Fields] fields closed by defaulthowever, it would be nice to have an option to keep the fields vertically and closed, as if there is lot of fields they don’t fit horizontally.
Also for the end user it can be confusing as in the page the fields are displayed in a vertical flow, so if he drag and drop them with the tabs it will horizontally.
i am doing a sort of page builder with carbon fields
i mean with a few fields it’s really nice : https://webstantly.com/carbonfields.png
but with lot of elements on a page it can become like that :
https://webstantly.com/cf2.pngForum: Plugins
In reply to: [Carbon Fields] fields closed by defaultjust tried it, it works great !
Forum: Plugins
In reply to: [Carbon Fields] fields closed by defaultgreat thank you !
Forum: Plugins
In reply to: [Carbon Fields] Displaying image fieldjust found the solution to the first question
https://www.ads-software.com/ideas/topic/functions-to-get-an-attachments-caption-title-alt-description
a nice function to keepfunction wp_get_attachment( $attachment_id ) { $attachment = get_post( $attachment_id ); return array( 'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ), 'caption' => $attachment->post_excerpt, 'description' => $attachment->post_content, 'url' => get_permalink( $attachment->ID ), 'src' => $attachment->guid, 'title' => $attachment->post_title ); }
Still needing light about escaping
Forum: Plugins
In reply to: [Carbon Fields] Displaying image fieldyes, now i try to display the alt, title and caption
i can have the alt with wp_get_attachment_image
and caption and title with wp_get_attachment_metadata
url with wp_get_attachment_image_url
but if i take wp_get_attachment_image i cannot have the others
in ACF the image fields was rendering an array with all these valuesAlso i don’t know which function to use to escape or sanitize, escape function, sanitize functions, which ones and in which case
Forum: Plugins
In reply to: [Carbon Fields] Displaying image fieldi have finally solved it ??
in don’t know how to delete my questionForum: Plugins
In reply to: [Carbon Fields] CF for "page building"?Forum: Plugins
In reply to: [Carbon Fields] CF for "page building"?You don’t need another plugin to do that, you can do it with the carbonfields complex field.
i was doing it with ACF flexible content
that’s how i discover carbonfields, looking to make this but with a library based pluginForum: Plugins
In reply to: [Carbon Fields] problem with complex fields groupsAnother small thing but not so important
sometime i want to put a layout in a complex field group, but it has not necessary a custom field in it
imagine a separator for exemple, that i want to put there so the client can place it where he wants between sections
for the moment i am obliged to put a “fake custom field” to make it workForum: Plugins
In reply to: [Carbon Fields] problem with complex fields groupsThank you it works now!, and i have understood, so i am going to adapt in my project
You really should put this type of simple examples on the doc site ??
Forum: Plugins
In reply to: [Carbon Fields] problem with complex fields groupsi’m sorry, but i don’t understand how to use this code
can you please write it concretely aplyed to these simple example fields
and tell me what is wrong in my code, from there i will be able to adaptContainer::make( 'post_meta', 'Custom Data' ) ->show_on_post_type( 'page' ) ->show_on_template( 'test-template.php' ) ->add_fields( array( Field::make( 'complex', 'crb_layouts' ) ->add_fields( 'driver', array( Field::make( 'text', 'name' ), Field::make( 'text', 'license' ), ) ) ->add_fields( 'teacher', array( Field::make( 'image', 'picture' ), Field::make( 'text', 'years_of_experience' ), ) ), ) );
and then that was the function to display them
function wst_display_fields() { $layouts = carbon_get_the_post_meta( 'crb_layouts', 'complex' ); if(isset($layouts)) { wst_display_driver($layouts); wst_display_teacher($layouts); } } function wst_display_driver($layouts){ foreach ($layouts as $layout){ if ( $layout['_type'] == '_driver' ) { $licence = $layout['license']; $name = $layout['name']; ?> <h2>Driver</h2> <?php echo $name; ?><br> <?php echo $licence ?><br> <?php } } } function wst_display_teacher($layouts){ foreach ($layouts as $layout){ if ( $layout['_type'] == '_teacher' ) { $picture = $layout['picture']; $year = $layout['years_of_experience']; ?> <h2>teacher</h2> <img src="<?php echo $picture ?>" alt=""> <?php echo $year ?> <?php } } }
Forum: Plugins
In reply to: [Carbon Fields] problem with complex fields groupsok, i’m going to try that, and will tell you if it works