I am building a site that promotes and sells measuring instruments. To each instrument you can connect probes of certain types. So under a product tab called Givare (probes), I need to show probes of different types, that can be used with the product.
Probe tab (tab title)
NTC probe type (probe type title)
A view (?) with all the probes of the NTC type (product with "Givare" and "NTC" as category or tag) should be displayed here (normally between 1 and 25)
Pt100 probe type (probe type title)
A view (?) with all the probes of the Pt100 type (product with "Givare" and "Pt100" as category or tag) should be displayed here (normally between 1 and 25)
And so on...
Take a look at a sample instrument in our old Drupal site: hidden link. Look under the tab "Givare". Lots of probes, sorted under different titles.
Can you advice me on the best way to replicate this in a Toolset template in our new WordPress site?
A custom product field (multiple lines) for entering the different probe types?
You will require to first decide is it ok for you to group posts by terms. In that case you will have to create taxonomy with term names like NTC and Pt100.
Hello
We sell hundreds of different measuring instruments and they differ from each other in many ways. Since I am dealing with a toolset template i still need a custom field in each instrument editing page, where I can assign which probes are going to be displayed for that particular instrument. Is that possible with the method you suggest? Or is everything configured in the View in the template?
I have found another solution also. If I explain how I do this, can you advice if this solution is a better option than Views?
This is what I did:
1. I created a new custom product field (single line, multiple fields possible) and named it "Givare"
2. In the template I added a "repeating field" block
3. I then used the dynamic source to link the block to my custom field "Givare"
4. In each instance of the custom field I then insert WooCommerce shortcodes like "[products tag="NTC" columns="4" etc....]"
See the attached images of how it looks. I can also add HTML in the field to create titles for each probe group. It seems to work, but one problem is that when I try to edit the template there are error messages at first (something about an empty field) and then finally the template opens in editing mode. The third attached image shows the template. For some reason it says that the repetable field is empty. But as you can see it works when viewing the product page.
EDITED: When accessing the template with the above configuration this error message shows:
Warning: Creating default object from empty value in /home/nordtecd/stage.nordtec.dev/wp-content/plugins/toolset-blocks/vendor/toolset/dynamic-sources/server/Sources/PostContent.php on line 59
And then after 2-3 seconds this message shows on top of the template:
Something went wrong while fetching the dynamic content from the selected source, with message: "Du saknar behörighet för att göra detta.". (Means "you do not have the authority to do this".
Well, its on you how you want to setup the structure. The structure how you setup if it works for you, you can go with that, no issues.
Regarding on content template edit page, you see empty result, can you please select the post from top of the content template's section "View With" dropdown and select the post where you setup the repeating field Givare then you should be able to see the result.
OK, I did as you said and changed the "View With" post to an instrument that had something inserted in the "Givare" fields. That worked, but only halfways.
As you can see from the images attached, only my extra html is shown (the h3 titles). Not the shortcode's content. However when viewing the product page the shortcode content is showing. Why is it not showed in the template editing mode? Is the Woocommerce shortcodes not fully compatible with Toolset?
The woocommerce shortcodes must be desired to work on frotnend not backend. You should try to add shortcode to non-Toolset element - does it work in backend.
As far as it works correctly on frontend, you may have to accept this limitation as its not the shortcode from Toolset. If you will try to add custom shortcode that should return "hello" if that should work that means toolset is not issue here.