I’m using ACF and Themer with a relationship field to show which community a real estate listing belongs to. I have two questions.
When I first set it up, I had the ACF type set to “Relationship” and couldn’t get BB to show it. When I changed it to “Post Object” it does. Is Relationship not supported?
Now that I got it working, it outputs as an unordered list. Is it possible to just get the text?
Okay, so now I understand why I couldn’t get it to work the first time. Unfortunately, using the Post module, I cannot add any other details I need.
But when I use an HTML module with custom layout I can add the relationship field using Post Object so I feel like I’m getting closer. Is there anything I can do to stop it from being an unordered list though?
Or, just think of it, use the Posts module, set the query (content tab) to ACF Relationship and build a custom layout in the Layout tab: this way, you should be able to have your text on a single line.
That’s what Danny suggested. The problem is, the “price” field I want next to the “community” relationship field is just a text field within the listing. Once I set the query to ACF Relationship, it doesn’t see the other fields as far as I can tell.
I just wish I could change the output of the post object to be text instead of an unordered list.
Not sure to understand.
If the Posts module is set to ACF Relationship, instead of Main or custom query, it fetches the related posts data.
I guess “price” is a field of the related posts, right?
If so, you use the Posts module custom layout and output the price using a Themer shortcode.
You can also add text or other shortcodes around this shortcode in the custom layout.
Or maybe i didn’t get the whole thing?
Can you specify the context?
Are you on an archive or single layout for instance?
No, “price” is a field in the single post I’m designing. The related “community” is a different CPT. So I’m trying to show which community this listing belongs to and the price field of the listing next to that. Does that make sense?
Yes, i understand you want to mix on the same text line, the output of a field belonging to the current post with several outputs of a field belonging to the related posts.
Maybe you could put the current post’s field in a column and the Posts module in a second column next to the previous, but it will be tricky.
Use CCS (Custom Content Shortcode), you’ll be able to mix the 2 outputs in the same text line.
Something like (dummy shortcodes, just for the example): [themer shortcode for the current post field] - [CCS related] [CCS related posts data] [/CCS related]
Yes, much more simple with CSS.
I still doubt how you can get mixed data in the same <ul> though, i should have missed something about your data sources
If I use the HTML module with the following code, it outputs both fields. The problem I’m having with that is the first one (relational post_object) outputs as the UL. The second one outputs as plain text. So I found if I use CSS to make it inline, it brings them together like I want. I was just hoping I could get rid of the UL entirely and kind of wondered why it outputs like that in the first place.
I guess the <ul> is generated by the Themer shortcode to separate the different related posts.
The simpler solution in your specific case seems to inline the <ul> indeed.
No, you look for the cleanest and efficient solution
Themer shortcode doesn’t handles ACF Relational correctly, you’re not the first one to fail with it.
If you’d had to build a more complex pattern, CCS could help, but here, i think the CSS tweak will do the job.