The View Container <div>
Views that use List and Table layouts are wrapped in a container <div>
with the following structure:
<div id="{anchor_id}">{content}</div>
{content}
is replaced with the View output and {anchor_id}
is replaced with the unique ID of the container.
The container ID
This is the structure of the container ID: #gv-view-{View ID}-{incremental counter}
The ID has an incremental counter that increases each time a View is displayed on a page. The counter starts at 1
.
Example of the container ID
We are displaying a View with an ID of 245.
The first time View #245 is displayed on a page, it will be wrapped in a container of <div id="gv-view-245-1">
. Note the View ID (245
) and the counter (1
).
If we embed the View again on the same page, the container will be <div id="gv-view-245-2">
. The View ID is the same, but the counter is now 2
.
The gravityview/view/wrapper_container
filter
You can modify or disable the container by using the gravityview/view/wrapper_container
filter.
Filter parameters:
Parameter | Type | Default |
---|---|---|
$wrapper_container |
string |
Wrapper container HTML markup. |
$anchor_id |
string |
Unique anchor ID to identify the view. Generated by the \GV\View::get_anchor_id() method. |
$view |
\GV\View |
The View. |
Disable the View container:
To prevent wrapping the View in a container (and restore the HTML structure before 2.15), add this filter:
add_filter( 'gravityview/view/wrapper_container', '__return_false' );