Skip Navigation

[Resolved] Post Content Layout with BB and UABB

This support ticket is created 6 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 9 replies, has 2 voices.

Last updated by saint 6 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#1175792

Hi team,

I am trying to enhance the existing Post content layout w/ UABB's Advanced Post module and their Custom Layout paired with different Views that would pull back various custom fields, or related custom fields. Specifically around

Instead, what I'm seeing is a "no items found" error message. Please see below for a visual walkthrough of what I mean.

hidden link

Thank you and happy New Year!

#1175972

Hi there,

Thank you for contacting us and I'll be happy to assist.

The "no items found" message suggests that the view is unable to find any game, matching the set criteria.

Based on what you've shared in the video, the solution for this lies in the "Query Filter" settings of the view.
( screenshot: hidden link )

Since the view is being called inside a UABB's Advanced Post module, you should first try the option "The current post in the loop". If the UABB plugin sets post loop's data in each block, the view will be able to pick the current "Deal" post type's ID and will show the custom field value from its related game.

If you still see the same message, then you'll have to select the 4th option: "The post with ID set by the shortcode attribute" and pass on the current deal post's ID manually.

After that, you'll update your view shortcode from:


[wpv-view name="game-cover-portrait"]

To :


[wpv-view name="game-cover-portrait" wpvrelatedto="111"]

Note: for testing purposes, I've used the ID "111" which is for a deal post shown in your video.

If this shortcode successfully shows the cover image from the connected game, you can replace 111 with a shortcode/tag from UABB plugin which returns the current post's ID.
( similar to how you're showing title, author, excerpt etc. screenshot: hidden link )

I hope this helps and please let me know how it goes.

regards & Happy New Year,
Waqar

#1178450

Hi Waqar,

Thank you for your help, I've gone ahead and tested this and it worked great! One thing I'm stumped on and can't seem to pull back the right value.

I've hacked a workaround using item = '$current_page', but I'm not clear as to why the same working View template (pointing to different custom fields) would not work where the only thing I changed was the Custom Field itself.

Please see: hidden link

Thanks!

#1178519

Good morning Waqar,

Along the same line, I'm trying to reproduce the same thing except instead of constraining by CPTs, I'm looking to display and constrain by Custom Taxonomy terms.

hidden link

Please let me know if the explanation made sense / was helpful.

#1179130

Hi,

Thanks for writing back and glad my message helped.

1. I checked your view "Service provider ⟩ display name (post content loop)" and noticed, two issues:

a). Since the reviews are shown on the same service provider's page, the options "Don't include current page in query result", should not be checked for "Query Options". This fixes the "no items found" message, when the shortcode [wpv-view name="service-provider-display-name-post-content-loop" wpvrelatedto="[wpbb post:id]"] was added to the template.

b). The second issue was that in the view's "Loop Editor" section, wrong content template was being called:


[wpv-post-body view_template="service-provider-display-name-post-content-loop"]

I updated it to call the view's own content template and it is now showing the first name:


[wpv-post-body view_template="loop-item-in-service-provider-display-name-post-content-loop-layout"]

You can keep on using any of the two views for displaying the service provider's name, but I'm sure you'll understand that the one with the "current page" will only work when the reviews block is being shown on the single and current service provider's page.

2. From looking into your website, it seems that the "Achievements" taxonomy is no longer in use. But for future reference, you can use conditional blocks ( ref: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/ ) with taxnomy terms too.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/displaying-taxonomies-conditionally/

I hope this helps.

regards,
Waqar

#1179382

Hi Waqar,

We are so close, thank you so much for your continued help. Hopefully this will be useful to others as well as they stumble upon this thread.

As it turns out, I believe the UABB Advanced Posts module is currently not capable of filtering out and/or excluding posts that are NOT in a relationship.

Their Query will pull back _all_ Reviews. So, despite the fact that Toolset can pull back all of the fields AND exclude others, at the end of the day, if UABB Advanced Posts includes all of the Reviews, this will be pointless.

So, I've started to look into creating my first Toolset Content Template in order to have more control over what fields in the post content layouts gets pulled back and shown, based on relationships.

Please see below for my initial attempt:
hidden link

Within the Content Template, I have some Views (e.g. "Service provider: reviews ⟩ deck") that I setup as a 1-column Bootstrap, but it seems to pull back a few metadata for just 1 record?

Thanks,

#1179914

Hi there,

Glad you're making progress and I'm happy to be a part of it.

You're thinking on the correct lines and the usage of the Post content layout widget from UABB plugin is resulting in unnecessary complication.

Before moving on to your specific question, I'd like to share a few key points, which will help you better understand the purpose of views and content template, in the context of "Views" plugin:

1. Whenever we need a collection, a list or a loop of multiple posts, a "View" should be used.

2. Whenever we need to show data/content from a single post item, a "Content Template" should be used.
(it can be to show the content of the current post or content of the current item inside a View's loop).

3. The "Views" can be nested into one another, as explained in this guide:
https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/

4. We can pass on multiple values to views, as shortcode arguments:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/

Moving on to the issue at hand, since you need to show "a list of Review posts, which are related to the current Service Provider's post", you'll create a "View" for review posts and filter them based on a relationship ( what we discussed earlier: https://toolset.com/forums/topic/post-content-layout-with-bb-and-uabb/#post-1175972 ).

When you're inside the loop of that view, you'll have the value of the current "Review" post naturally and if you need to call in some fields from the current "Service Provider", you can use the ID passed through the attribute in the view's shortcode.

I hope the above points will make things more clear.

regards,
Waqar

#1180184

Hi Waqar,

This was really great - based off your reply, I've been able to reproduce about 90% of the content in the UABB AP module (minus the styling.)

Please see: hidden link

There's one problem that I've encountered, and it may be because of an issue with nested "[wpbb post:id]" shortcodes?

But, I'm having trouble pulling back the 'Client' & 'Service Provider' values when the "wpvrelatedto=" is set to a dynamic BB shortcode within the Content Template. It works fine when the value is static (e.g. '111'), but breaks and just shows a

"]

when not.

Once we've gotten a handle on pulling back all of the needed fields, I'll look to replicate this in some type of a stylized format such as Bootstrap - speaking of which, are there any plans to shift us over to Bootstrap 4?

Thank you help so far!!!

#1180693

Hi,

Thanks for sharing the screencast.

While looking into the settings, I noticed two issues:

1. Since the "[wpbb]" shortcode is not among the View's built-in shortcodes, it needed to be registered in "Third-party shortcode arguments" settings, before using it within other View's shortcode:
https://toolset.com/documentation/user-guides/shortcodes-within-shortcodes/

I've added it at Toolset->Settings->Front-end Content tab and the escaping issue is now fixed.
( screenshot: hidden link )

2. In the query filter settings of view "Client ⟩ first name (only client and review relationship)", option "The post where this View is shown" was selected.
( screenshot: hidden link )

Since we've added this child view inside the loop of the parent view, option "The current post in the loop" should've been selected. I've updated that and the view is now showing the content correctly.

As for the Bootstrap4 support, work is underway, but I'm afraid, we don't have a time estimate to share at this time.

If you'd like to start using Bootstrap 4 now, you can choose to disable loading of Bootstrap resources from WP Admin -> Toolset -> Settings -> General.
( you'll see the option "This site is not using Bootstrap CSS" )

Once that option is set, you can load the Bootstrap 4 resources manually from the theme and adjust your markup code accordingly.

As result, once Bootstrap 4 support will become available in Toolset, you won't have to redesign everything, from all over again.

regards,
Waqar

#1183379

Thanks, Waqar! Those worked perfect and I've make the necessary modifications. Have a wonderful day!