-
-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support [if] shortcode fields recursively (magic-tags) #5471
base: main
Are you sure you want to change the base?
Conversation
@jimtrue @sc0ttkclark This PR will need a thorough testing round with all kings of shortcode and template usages (widgets??) @sc0ttkclark especially this part: https://github.com/pods-framework/pods/pull/5471/files#diff-ab22a13affdb28c998776e73a1808abfR579-R585 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 8 error(s)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 4 error(s)
|
||
$field_type = $pod->fields( $atts['field'], 'type' ); | ||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were the changes at https://github.com/pods-framework/pods/pull/5471/files#diff-3af4ca77fc3cd86765f464bb6fa7000725503257e80ccc885464b3ad43ab36c4L536-L540 not enough to do what you wanted here, is this part of the code still necessary? It seems that the previous field() alone would do what this does
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, currently only using the field method isn't enough. The field type and Pod object needs to be updated as well so traversals will work properly.
However, I do agree that this might not be the best way to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs more discussion on the field() workaround
I recommend punting this and adding |
Traversal is in Whatsit::get_field() right now, what else do we need to do here to leverage that? |
@sc0ttkclark Not sure, if you say traversal is already there then maybe this PR isn't needed anymore, or can at least get a big refactor. |
Fixes: #5470
Description
Add support for recursive
if
shortcodes for relationship fields. Example:[if relationship.relationship_field] content [/if]
[if relationship.sub_relationship.sub_relationship_field] content [/if]
TODO
[if]
(confirmed on Slack by Adam Spelbring): 2021-04-06)[each]
ChangeLog
Checklist: