I created a filter for city on archive page but it is not filtering. The filed comes from a repeatable field group. Also all the markers on map are returning same page title and logo in the loop. Like you can see in the attached screenshot, marker needs to show Smart3Dme and its logo but is showing name and title from other listing.
please refer to
hidden link
I created a filter for city on archive page but it is not filtering.
Unfortunately it is not possible to filter a View or WordPress Archive of posts by a custom field in a Repeating Field Group applied to that post type. You can filter a View of the Repeating Field Group by this custom field, then in the Loop of that View you can get information from the related Company post by using the "Post selection" tab in the field dialog (see screenshot).
Also all the markers on map are returning same page title and logo in the loop.
Remove item='$current_page' from this shortcode:
[types field='company-logo' title='[wpv-post-title item="$current_page"]' alt='[wpv-post-title item="$current_page"] Logo' size='custom' height='100px' width='100px' resize='proportional' item='$current_page'][/types]
You should only use item='$current_page' if this View is placed on the Company single post. Since the View is shown on an archive, you should remove it.
Thanks for your reply Christian.
I did try without item='$current_page' at first but it didnt work which is why I had added item='$current_page'. Please see the screenshots what I am getting after removing item='$current_page'. Non of the markers are returning proper logo or title now. One think to do that the marker view is looping through address field inside Repeating Field Group.
I didnt quite understand what you suggested for the filter but will try to go through documentation ones again.
I have been trying a lot but couldnt find a solution to the issue yet.
Is there a way I could pass some arguments to short code? I saw that the view which I am using for markers is not getting the post id or title right, may be if possible could pass it as argument...
For the filter I guess I will have to wait till your team adds in the feature.
Please see the screenshots what I am getting after removing item='$current_page'. Non of the markers are returning proper logo or title now.
The Map Markers are created in View of Company Location RFGs, but the company logo is a custom field on the parent Company post. The syntax for accessing a custom field on a RFG's parent post is like this:
[types field='company-logo' title='[wpv-post-title]' alt='[wpv-post-title] Logo' size='custom' height='100px' width='100px' resize='proportional' item='@company-branches.parent'][/types]
The syntax uses the "item" attribute to specify the post context. 'company-branches' is the slug of this RFG, and '.parent' because we want to get the post value from the parent post. I made this change in your View and the images appear as expected now.
Oh ok! I had tried item='$parent' didn't know about .parent syntax. Thanks again for your help Christian and explaining about it.