soflyy / oxygen-bugs-and-features

Bug Reports & Feature Requests for Oxygen
https://oxygenbuilder.com/
314 stars 29 forks source link

Dynamic data or PHP support to easy post and repeater query #1869

Open pimpawell opened 3 years ago

pimpawell commented 3 years ago

Please add new option to easy post and repeater something like this: https://dropmefiles.com/kYJw9

This feature will make it easier to customize the output of posts and custom post types and expand the possibilities. Now, to add such a possibility, you have to use the php code in a separate place, which adds inconvenience.

Example

add_action( 'pre_get_posts', 'admin_filter' );
function admin_filter( $query ){
global $post;
$usid = get_current_user_id();

if( $post->ID == 2) {
  $query->set( 'post_type', [ 'tour', 'release', 'concert', 'playlist', 'artist' ] );
   $query->set( 'post_status', [ 'publish', 'draft', 'trash'] );
  $query->set( 'author', $usid );
}  

}; 
pimpawell commented 3 years ago

easypost_and_repeater

avocadesign commented 3 years ago

+1000

I've been wrestling with this over the last few days - it's such a pain to have to place code blocks on the page to deal with this - we would prefer this to be integrated into the repeater element

olithomp commented 3 years ago

Silly question, but.. ?

I am looking to customise the Oxygen builder "repeater" element by populating dynamic data from custom post/field types (created with the Metabox.io plugin).. is it possible?

ideally I want to collect:

post: heading post: feature image post: content (limited to 60 words)

Not sure what code goes where, or if you could help me on this thread.. Metabox supply a "custom post type code generator" if that's helpful at all..?

https://metabox.io/post-type-generator/

Would be so GREATFUL to any support you can give!! [ BECAUSE I have 14days to refund Metabox if I can't figure out how to make it compatible with Oxygen]

Huge Thanks, O

pimpawell commented 3 years ago

Silly question, but.. ?

I am looking to customise the Oxygen builder "repeater" element by populating dynamic data from custom post/field types (created with the Metabox.io plugin).. is it possible?

ideally I want to collect:

post: heading post: feature image post: content (limited to 60 words)

Not sure what code goes where, or if you could help me on this thread.. Metabox supply a "custom post type code generator" if that's helpful at all..?

https://metabox.io/post-type-generator/

Would be so GREATFUL to any support you can give!! [ BECAUSE I have 14days to refund Metabox if I can't figure out how to make it compatible with Oxygen]

Huge Thanks, O

Hello, create a code block in the repeater and paste this code

<?php

/*
rwmb_the_value( $field_id, $args, $post_id, $echo );

$field_id - The field ID. Required.
$args - Extra arguments for some field types (image, file, etc.). Optional. Can be array or a string in format param1=value1&param2=value2. See more details in field types (on the left menu, section Fields). Optional.
$post_id - Post ID that custom fields are get from. Optional. If not present, current post ID is used.
$echo -Echo the HTML output (true - default) or return it (false).
*/

rwmb_the_value( 25, true ); //echo field with ID 25 from post in repeater

?>
olithomp commented 3 years ago

Thank you Pimpawell,

Would just like to ask as, because don't know PHP very well, and i'm not sure if you are also explaining the code in shorthand..

So could you help break down how the code works so I can customise retrieving heading, feature image, restricted word count content..

1) Is this the Core bit of code?

<?php / rwmb_the_value( $field_id, $args, $post_id, $echo ); / rwmb_the_value( 25, true ); //echo field with ID 25 from post in repeater ?>

2) Are these the CHANGABLE values for rwmb_the_value?

$field_id = FIELD $args = HEADING/ FEATURE IMAGE property etc.. $post_id = POST ( 25, true ); //echo field with ID 25 from post in repeater = 25 WORDS output..

Forgive my complete guess work.

I haven't really used php and would like to make a little sense of the code before using it..

Many Thanks, O

abd-shouman commented 3 years ago

I am not sure why this does not have more attention, but I think it should. Having the ability to set manual and dynamic queries in EasyPost/Repeaters is important in my opinion.

ayhanmalkoc commented 3 years ago

+1

perrelet commented 3 years ago

+1

0x7466 commented 2 years ago

+1