I am trying to:
Display custom fields from Product posts that are in a many-to-many Toolset relationship (weed-product) with the current Weed post, using a Toolset View.
The relationship itself is working correctly:
Each Weed is connected to the correct Products
The View loop runs the correct number of times (e.g., 19 products)
Relationship data can be confirmed via Toolset APIs and admin UI
However, when attempting to output Product custom fields (for example product-name) inside the View loop, the fields render blank, even though the loop itself executes.
Link to a page where the issue can be seen: hidden link
I expected to see:
For each related Product in the weed-product relationship:
The Product’s custom fields (e.g. product-name) displayed correctly
One unique Product’s field value per loop iteration
In other words, a list of Products related to the current Weed, with their associated Product field data visible.
[types field="product-name"][/types]
[types field="product-url"][/types]
<button>Test</button>
[types field="product-name"][/types]
Instead, I got:
The View loop renders the correct number of iterations (HTML structure repeats correctly)
Static HTML inside the loop (e.g. <button>Test</button>) renders as expected
All Toolset custom fields inside the loop output blank
Additional observations:
Logging via toolset_get_related_posts() confirms that each relationship has a valid child Product ID and intermediary post
This suggests the View is looping correctly but is not entering a per-row relationship context, so Product fields cannot resolve correctly.
Please check console and see the logs I have being created to verify the relationship is seeing each post.
Hello. Thank you for contacting the Toolset support.
When I try to login using the admin access details you shared - as soon as I submit the admin access details it redirect me on "Two-factor authentication" page of "Protect Your PBI Gordon Corporation Account".
Can you please disable "Two-factor authentication" for now after that I will try to login to admin and review your view settings.
I have set the next reply to private which means only you and I have access to it.
Is there any chance you were able to take a look into this further once I gave you access? This is one of the last bugs we are trying to resolve before updating our production site.
Checking back on this as I saw some changes happening on the site, but no status update here. Please let me know if there is anything I can do to assist.
The thing is that - with the release of Toolset Blocks we shifted the focus in support of working with the native WordPress block editor instead of providing and maintaining support for a different page builders, and for now that will continue to be the case with Divi builder as well.
We don't expect to do specialised work to integrate with Divi 5, but it could be possible only when given that version 5 will see Divi shift to work with the block editor and that Divi 5 and Toolset co-exist more comfortably than was the case with the changes in Divi 4. So, honestly it will be matter of choice for you but you can use native block editor and Toolset offers also legacy editor to build views/content templates/archives.
It was really challenging task to offer workaround in this case and fortunately I've working workaround to share:
I've added the following code to "Custom Code" section offered by Toolset:
=> hidden link
function toolset_loop_index($increment = false) {
global $WP_Views;
static $custom_loop_index = -1;
if($increment) {
$custom_loop_index++;
}
return $custom_loop_index;
}
function func_get_current_post_id_shortcode($atts = array()) {
global $post;
global $WP_Views;
if(isset($atts['increment_loop_index']) and $atts['increment_loop_index']=='yes'){
$index = toolset_loop_index(true);
} else {
$index = toolset_loop_index();
}
$result_posts = $WP_Views->post_query->posts;
$element = $result_posts[$index];
return $element->ID;
}
add_shortcode('toolset_post_id', 'func_get_current_post_id_shortcode');
And within yoru view' Loop Editor I've adjusted the code as given under for your Loop template "Loop item in Display Linked Producted":
=> hidden link