If you have an AJAX block of your View in the sidebar of the View page rendering, the AJAX content will replace both b/c it uses the generic view-content-view-name that is present on both the page and the block rendering. If you only do the html replace on the .view-content-view-name that is a descendant of .block, it will leave the page rendering alone.

Comments

febbraro’s picture

Note to self:

Investigate if views_build_view('block', $view) wraps it in a .block as well. It might not. If not then consider putting a custom div with a non-conflicting css id or class that use that to do the AJAX replace.

febbraro’s picture

Status: Active » Fixed

The fix works best if I just create a new div with a specific class. I chose "ajax-view-block-[viewname]"

febbraro’s picture

Title: Only replace content if it is a descendant of .block » Only replace block content if block and page apear at the same time.
febbraro’s picture

Status: Fixed » Closed (fixed)