Skip Navigation

[Resolved] Archive page: missing styles when the url change?

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 3 voices.

Last updated by Minesh 11 months, 2 weeks ago.

Assisted by: Minesh.

Author
Posts
#2679847

Hello,
at this url I have an archive page: hidden link

When the user hover on an image, there is the typical zoom effect on the image.

This effect stops working correctly when the url changes, that is when going to a different page or to a filtered results page:
hidden link
hidden link

When refreshing those url, however, the page behaves correctly once again.

Can you please help me find out what is happening (and how to fix it)?

Thank you in advance
Best Regards,

Luca

#2679872

Nigel
Supporter

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

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

Hi Luca

It is not uncommon for something to not work the same after results are updated via ajax, typically because JavaScript event listeners that were added to the original content need adding back to the new content loaded via ajax, but that doesn't seem to be what's going on here.

Checking the page source, it looks to me that in the output of your View which displays these images, the images are generated by a Toolset Image block with hover styles set on them.

I just tested the same on my own local test site and that worked as expected. So it appears to be something specific to your site.

Could we get access to your site to double-check the set up?

Do you have a staging site we could work on, as we may need to disable plugins to rule out possible conflicts.

Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.

#2679958

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I see you are using mix container blocks. One belongs to Toolset Blocks container block and another container block belongs to Generate Blocks.

We have a know issue and here is the errata for that:
- https://toolset.com/errata/generateblocks-styles-lost-on-front-end-when-using-content-templates/

I've added the following code to "Custom Code" section offered by Toolset to apply the fix:
- hidden link

add_filter('generateblocks_do_content', function ($content) {
 
    // Array of post types slugs which use Content Templates or custom WPAs
    $post_types = array( 'autoclaves' );
 
    if ( is_singular( $post_types ) )
    {
        global $post;
     
        // is the post being displayed with a Content Template?
        $template_id = apply_filters( 'wpv_content_template_for_post', 0, $post );
     
        if (isset($template_id) && !empty($template_id)) 
        {
            if (has_blocks($template_id)) 
            {
                $template = get_post($template_id);    
                // Append the template "content" to the post content, for scanning by GP
                $content .= $template->post_content;
            }
        }
    } elseif ( is_post_type_archive( $post_types ) ) 
    {
        // is there a custom WPA for this post type?
        $post_type = get_query_var( 'post_type' );
        $wpa_id = wpv_has_wordpress_archive( 'post', $post_type );
        if (isset($wpa_id) && !empty($wpa_id)) 
        {
            $wpa_helper = get_posts
            ( array
                ( 
                    'post_type' => 'wpa-helper',
                    'post_parent' => $wpa_id,
                    'post_status' => 'publish'
                )
            );
            if (isset($wpa_helper) && !empty($wpa_helper))
            {
                if (has_blocks($wpa_helper[0])) 
                {
                    $content .= $wpa_helper[0]->post_content;
                }
            }
        }
    }
    return $content;
});

Can you please confirm it works as expected now.

#2679965

Now it's working!
I was unaware of the issue, thank you very much Minesh & Nigel!