Support [if] shortcode fields recursively (magic-tags)#5471
Support [if] shortcode fields recursively (magic-tags)#5471JoryHogeveen wants to merge 22 commits intomainfrom
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 |
Adds support for each tags
| $field_data = $pod->field( $atts['field'] ); | ||
|
|
||
| $field_type = $pod->fields( $atts['field'], 'type' ); | ||
| /** |
There was a problem hiding this comment.
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.
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.
sc0ttkclark
left a comment
There was a problem hiding this comment.
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
ifshortcodes 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: