Skip Navigation

[Resolved] Shortcode and View Layout

This support ticket is created 4 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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: Africa/Casablanca (GMT+01:00)

This topic contains 9 replies, has 2 voices.

Last updated by CaseyK4294 4 years ago.

Assisted by: Jamal.

Author
Posts
#1843563

Tell us what you are trying to do?
Insert a toolset view into a page built with elementor using shortcode
When I enter the short code [wpv-view name="view-name"], and view the page built with elementor, it changes the view layout from three columns to one. I am not sure if I am using the correct shortcode.

Is there any documentation that you are following?
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#displaying-content

What is the link to your site?
This is the page (the view is under Featured Towns heading):
hidden link

This is the page where I originally built the view to test it and setup the layout:
hidden link

#1844339

Hello and thank you for contacting the Toolset support.

From what I can gather so far, the view was built using the blocks editor, and then you are including it in an Elementor page using a shortcode. If we analyze the page where the view was built, we can see that the block editor adds some styling that makes the 3 columns grid work, check this screenshot hidden link

I'll suggest the following:
- Create a content template and create a similar view inside of it, using the blocks editor. The template should not be assigned to any custom post type or archive.
- Include the content template inside your Elementor page using a shortcode:

[wpv-post-body view_template="name or slug of the content template"]

If this does not work either, let me know and I'll check this with our developers. In that case, I'll need you to include the debug information to have more information about your setup.
- https://toolset.com/faq/provide-debug-information-faster-support/

#1844411

Ok, I will try this, thank you for your assistance. Will reply again after I try!

#1845045

Awesome, I'll set this ticket as waiting for your feedback. It should be kept open for 3 weeks and you will receive automatic notifications before closure.

#1849279
Screen Shot 2020-11-18 at 5.13.34 PM.png

Hi Jamal,

So your solution worked for me to insert the view, for sure, but it created two follow up layout challenges.

1. One is that the image block in the view will not center. I have the block alignment settings to center, and do not see any other options or settings for centering the image. It is centered in the template editor (screenshot attached)

Here's the page where the alignment of that image goes off from the block setting:
hidden link

2. Can I set up the view to have 3 columns like I did on the one created in the blocks editor?

Thanks!

#1849803

The image is not centered because of some Elementor styles. Check this screenshot hidden link

I wonder if using a content template, as I suggested before, did work?

Can you allow me temporary access to your website and let me check this further? Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1849955

I added a custom class to the image block to target it with custom CSS, check this screenshot hidden link

Then I added the following CSS code to the view, check this screenshot hidden link

.force-center {
    margin-left: auto !important;
    margin-right: auto !important;
}

As you can see this fixes the alignment of the image hidden link

#1849959

Thank you, Jamal!

My last question on this issue is, is it possible to set up a view to have columns in the content template like I was able to do when I created a view in a page? The loop output settings for columns is not there when creating the view on the content template.

#1850621

The View Block has some children's blocks. The loop style is defined on the "View loop" child block. Choose it from the block navigation then change the loop style in the right sidebar. Check this screenshot hidden link

I already changed it for this view, and it gives the desired results hidden link

#1851569

My issue is resolved now. Thank you!