Skip Navigation

[Eskaliert zur 2. Ebene] A view is not displayed on a page

This support ticket is created vor 4 Jahren, 3 Monaten. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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/Hong_Kong (GMT+08:00)

Dieses Thema enthält 15 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Luo Yang vor 4 Jahren, 3 Monaten.

Assistiert von: Luo Yang.

Author
Artikel
#1736231

Hi,

I am using the traditional way of defining a view, but it is not displayed on the page where I put its shortcode.
Check out the following video: versteckter Link

versteckter Link

Thanks for your help.
Regards,
Jose A.

#1737163

Dear Jose,

Thanks for the video.

How do you setup the custom field "Download Type"? is it a custom reference field?
Are you going to do these:
In a single "sdm_download" post, display related brother "sdm_download" posts based on "Download Type" reference field

If it is, Toolset reference field is based on one-to-many relationship, so you can try these:
1) Create a new content template, for exmaple "brother-sdm_download-posts"
2) In above content template, display a post view:
- Query "sdm_download" posts
- Filter by post type relationship filter:
Select posts in a "Download Type" relationship that are related to the Post where this View is shown.
- In view's loop display "sdm_download" post information
3) In single "sdm_download" post, display above content template shortcode with item attribute, for example:
[wpv-post-body view_template="brother-sdm_download-posts" item="@download-type-field-slug.parent"]

Please replace download-type-field-slug with your "Download Type" reference field slug
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items

#1737369

Hi Luo,

I believe that everything is correctly defined.
The problem is that if I do everything from a view block with gutemberg everything works correctly, however if I do it creating a view in the classic way, it does not work.
I have Toolset Blocks plugin enabled, would I have to disable Toolset Blocks plugin and enable Toolset Views plugin?

Thanks for your help.
Regards,
Jose A.

#1738231

It should be able to work in Blocks or Views plugin, Toolset Blocks plugin is advanced version of Toolset Views plugin, so you don't need to switch to Views plugin, if you need more assistance for it, please provide a test site with the same problem, I can setup a demo for you using classic way

#1738413

Thanks for the details, I have done below modifications in your website:
1) Edit the post view "Download_View"
versteckter Link
in section "Query Filter", change the filter as below:
Select posts in a Download Type relationship that are related to the Post with ID set by the shortcode attribute wpvrelatedto.
eg. [wpv-view name="view-name" wpvrelatedto="123"]

As I mentioned above, the Toolset reference field is based on one-to-many relationship, so you will need to use relationship filter.

2) Edit the page "Downloads3", change the shortcode as below:
[wpv-view name="download_view" wpvrelatedto=5362]

test it in front-end:
versteckter Link

It works fine, please check if it is fixed. thanks

#1738455
2020-08-14_9-35-43.png
2020-08-14_9-34-01.png

Hi Luo,
Thanks for your help.
But now you can see the other problem that I mentioned, it is not displayed the same with a view created with the classic mode as with a view created with Toolset Blocks.
As you can see, in the classic view the fields are not shown and it is only shown that they are protected.
Something very strange is happening.
The same Downloads fields are used in both views.
versteckter Link
versteckter Link
Look at the screenshots.

Regards,
Jose A.

#1738509

Thanks for the details, in the classic view "Download_View":
versteckter Link
section "Loop Editor", you are using shortcode [wpv-post-body], this shortcode will apply wordpress password protected feature too.

In your case, you can display those custom fields shortcodes directly without content template, for example: replace the shortcode from:
[wpv-post-body view_template="loop-item-in-download_view"]

To:

[wpv-post-field name="sdm_description"]
[wpv-post-field name="sdm_upload_thumbnail"]
[wpv-post-field name="sdm_item_file_size"]
[wpv-post-field name="sdm_item_version"]
[wpv-post-date]

And test again

#1738541

Thanks Luo for your help.

But I want to use a template that I will later format using gutemberg blocks.
How can I use a template without using wpv-post-body?

Thanks.
Regards,
Jose A.

#1738559

No, in classic editor, if you are using a content template, it is required to use [wpv-post-body] shortcode to display it.

But there is a workaround, you can create a temporary page:
versteckter Link

Add a view block "download_view3", with same setting, and use Blocks editor to design/style the loop item.

In target page:
versteckter Link
Display above a shortcode block, output view + attribute:
[wpv-view name="download_view3" wpvrelatedto=5362]

#1738673

Hi Luo,

This is very interesting.
This way it is no longer necessary to create the classic view that I had created, right?
The only problem I see in this system is that there is a page created that a user, willing or unwilling, could open from the browser.

Thanks.

Regards,
Jose A.

#1741011

Hi Luo,

I want to remove the "Clase de producto" field and use only the "Download Type" field to filter the items.
In the example you indicated (versteckter Link), you were able to make the relationship "in the Download Type relationship" and you were able to select the "DownloadType" field in "Specific", however, on page (versteckter Link) I cannot select the type "DownloadType" and I'm using exactly the same types.
Do you know why I can't?
Check out the following video: versteckter Link

When you go to look at this problem, tell me so that I will create a new user for you and disconnect iThemes security.

Thanks for your help.

Regards,
Jose A.

#1741501

Q1) This way it is no longer necessary to create the classic view that I had created, right?
Yes, you are right, it is no longer necessary to create the classic view.

For the temporary page, you can save it as draft, so it won't be display in front-end.

Q2) Thanks for the video, you need to save that page, and refresh your browser and test again.

And the credentials you provided above is not valid any more, please check it, thanks

#1741537

Hi Luo,

Thank you for all of your help.
Yes, by saving the page, leaving the page and re-entering the page I can select the fields to make the relationship, but this is very unintuitive, you should find another solution.

Regards,
Jose A.

#1741601

Thanks for the feedback, I have escalated this issue, will update here if there is any news.

#1741603

Ok. Thanks Luo.