Skip Navigation

[Resolved] Styling issue with Custom Search in Child Views and Divi

This support ticket is created 6 years, 7 months 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.

Our next available supporter will start replying to tickets in about 2.18 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 11 replies, has 4 voices.

Last updated by Nigel 6 years ago.

Assisted by: Nigel.

Author
Posts
#632634
Child View filtered.JPG
Child View unfiltered.JPG

I am having a child view with filtering options, similar to a shop (parent) with products (child) and a search filter using Divi and the latest Toolset Betas

On Load of the page with the parent and child everything looks like expected until i use the search function. Then the 1st search result inherits the styling from the parent.

To set this up I created the child view with the unformated option.

After looking a bit deeper into this I noticed the following change in the classes -> Images
The first result receives the same classes like the parent: .et_pb_section_0

Now i wonder if I did something wrong or would this need attention on your side ?

Best regards, Peter

#634382

I tried to set up such a similar structure locally but not using DIVI; instead of using Toolset only, and this does not happen.

It is rather strange that an HTML class is changed without you coding it into the editors.
Sounds like JS is adding that.

Does the issue also persist with a WordPress Default Theme and NO Plugins BUT the Toolset Plugins?

If not, could you then re-enable the Plugins one after the other, and check the issue each time you enable a plugin?
Please report me when the issue comes back
It might also be due to the Theme.
Please do reactivate your Theme only after you are sure the issue isn't coming from a 3rd Party Plugin.

I suggest as well to check if this is due to the page builder used.
If this does not happen within Views alone when you use HTML, it may due to the Builder that adds the classes on the fly.
We also would need to know what search update form you use (AJAX or full reload)
I believe to see that you use AJAX - correct?

Even so, locally this does not happen.

If this happens only with the Builder, I am not sure if we will be able to fix this as it sounds rather like an issue with the builder, but we will definitely look into that and find out why it happens.
In that case, I think the best is you would submit us a copy of that site so we can see it locally happen and narrow it down.
https://toolset.com/faq/provide-supporters-copy-site/

#635561

Hi Beda

Thanks for this fast reply and looking into this 🙂

Looks like it must be then Divi that enumerates the section new after receiving the results from the ajax submit.

I will open a ticket at elegant themes with this issue, as it might affect other users as well, sooner or later, while the Divi / Toolset Combo is becoming a nice solution for building responsive web-apps based on WordPress

In the meantime i could resolve this issue with adding my own classes to the affected sections and style them outside of Divi with manual written CSS.

I will keep you posted with their reply

#642219

I would like to look into this closer.

It may be that the builder does that, but there may be a way to avoid it as well.

Please submit me the following data, so I can prepare a workspace and debug this problem.
If I succeed I can either let the guys from DIVI what happens, or I can file a task in our own workflow, in case we can or should fix the issue.

It seems to me this is an annoying and unexpected problem, that should be solved.

Data to submit:
- a copy of your site is the best:
https://toolset.com/faq/provide-supporters-copy-site/
- if this is not possible, a Zipped up copy of the public HTML folder in your FTP (your WordPress install) and a ZIP of the Database Export of your website.
- in any case, the exact steps of where I can see the issue, and how I could replicate it in a minimal Install using those methods.

I can then deploy this and put my hands on the real case.

A private reply is activated so all information is submitted securely.

#678624

I could not replicate the site locally as it seems altered, it does not resolve the login response.

However having a look at this on your site, I see that both links (hidden link and hidden link) present et_pb_section_n, where n is an increasing number starting at 1.

This cannot be changed by CSS.
How did you fix this?

It seems to be all is as expected. The counter must be something from the builder that increase each loop iteration, good for targeted addressing of the DIV for example.

#679072

Hi Beda

Thanks for looking into this a bit deeper 🙂

Indeed every loop increases the number, which works ok on a first page load as every section gets sequentially numbered.
But after using a filter option the loop results start off with zero instead of the initial number (which could be everything from 1 and higher, depending the page layout) and so inherits the styles of the previous sections.

So to avoid this at the present I did the following:

- in the Content Template I used the Divi Builder only for the rough positioning of the different fields
- all the styling options in Divi I left at their default value
- then assigned my own CSS classes to the elements to be customized in the Advanced tab in Divi
- Did write the CSS styling manually

This works ok, but then why I would need Divi at all to style the loop content?

The big quest imho is where and why the first section in the loop changes the number after filtering, instead of keeping the initial value of the first loop result and increment from there?

It is out of my scope to see what causes this - is it views or is it divi? But I think this is an issue that will affect all Toolset/Divi users and needs to be solved somehow so the styling of the loop content template could be done completely in Divi.

Best regards, Peter

#679140

Hi Beda

I forgot: In case you find out about what causes this, could you please let me know the details, so I can post them to the Divi Support Ticket too.

Best regards, Peter

#691315

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Peter

Beda asked me to take a look at this as he couldn't get your Duplicator to work and I have recently been looking at Divi styling issues.

I set up a Divi test site and was able to reproduce the problem.

On my test site I have a page which uses Divi page builder to design the page, and inserted a View with filter controls into a text module. The output of the View is also designed with the Divi page builder, fields inserted into a text module using Views shortcodes.

On the initial page load the page section where the View is inserted gets the class .et_pb_section_0, and the results of the View are each in their own section with class names .et_pb_section_1, .et_pb_section_2, .et_pb_section_3 etc.

If my View is set to update via a page reload then everything continues to work in the same way.

If my View is set to update via ajax then the problem appears, and the first View result has the class .et_pb_section_0.

So if I have custom styles for .et_pb_section_0 (or .et_pb_row_0 or .et_pb_text_0) that are supposed to target the section where the View is inserted, the first result of the View will now pick up these same styles.

That's enough for me to be able to escalate this to our developers for them to investigate whether it's possible for us to fix this from our side.

I'll keep you posted when there is any news.

#902414
tax1.jpg
tax2.jpg

Hi

I have the same problem:
hidden link

Waiting for the solution...

#1146415

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Peter

I'm just reviewing my escalated threads to see if I missed anything, and it seems I overlooked an update in the internal ticket for this.

The developers took a long hard look at this and concluded that it is not something we can fix, the system Divi uses to add incrementing class names is, shall we say, fragile, when it comes to interactions with Views (specifically, but not only, when using ajax).

The short answer is that such classnames should not be used for styling purposes, you should add your own classes. I realise this limits the ability to use Divi to set styles on its modules, which you alluded to above (https://toolset.com/forums/topic/styling-issue-with-custom-search-in-child-views-and-divi/#post-679072).

Sorry for the delay getting back to you, and for not being able to offer a solution.

#1146718

Hi Nigel

thanks for getting back on this 🙂

In the meantime I found a most elegant solution to solve this issue for good in 3 easy steps.

Step 1 - I got Astra Pro
Step 2 - Rebuild the site from scratch to avoid any leftovers from Divi
Step 3 - Replace the old Divi based Site with the new Astra Site by using Duplicator or a similar tool

Another advantage I got out from this is that Bootstrap can be used again!

There are some Divi cleanup plugins and tutorials available but they fail at Toolset Content Templates created in Divi and some 3rd Party Divi Modules

A pity as I thought the usage of the Divi Builder for creating Toolset templates would make things a lot easier. At least it sounded like an interesting concept.

So after some practical experiences I can safely conclude that using Divi and Toolset together at the moment of writing is something that should be avoided if one wants to push a bit beyond the borders of the simple examples.

#1147086

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Peter

I'm glad you found a good solution, even if that meant stopping using Divi. It is a popular theme and therefore we have tried our best to work smoothly with it, but it does certain things in certain ways that mean some issues inevitably arise.