What Webvanta Inserts in Your Code (and how to stop it)

The Webvanta system delivers all your front-end code unmodified, with just a few exceptions. This article explains just what the system adds, and how you can stop it from doing so if you so desire.

The Webvanta Toolbar

To provide easy access to the control panel and the ability to use in-place editing, a small bit of code is inserted at the bottom of the body section of each page. The code is something like this:

<div id="webvanta-features" class="wvif">

<script type="text/javascript" src="/admin/v2/js/webvanta-bootstrap-2.0.0.js"></script>

When a page is loaded, the "webvanta-bootstrap" JavaScript file checks to see if there is a cookie indicating that the user is logged in, and if so, it injects the toolbar code into the "webvanta-features" div and positions that div at the top of the visual page.

To prevent the automatic injection of this code, put the class "wv-no-features" in your html element:

<html class="wv-no-features">

Put this code in any template where you don't want the bootstrap or toolbar code to be loaded. You will have to either add your own link to the control panel or manually type in the URL to get there. (You can always use www.yoursite.com/a to access the control panel.) You will also lose access to in-place editing.

Built-In Analytics

Webvanta provides built-in analytics that you can access through the control panel. (This is only available after sites have been "live" for a day or so.)

To enable the analytics tracking, code such as the following is inserted at the very end of the body of each page's code:

<script type="text/javascript"> var iHOST="http"+((window.location.href.charAt(4)=="s")?"s":"")+"://t5.prnx.net/"; document.write(unescape("%3Cscript src='"+iHOST+"js/tc.js' type='text/javascript'%3E%3C/script%3E")); </script> 

<script type="text/javascript"> iT(5,"www",0); </script>

If you aren't going to use the built-in analytics and you don't want this JavaScript inserted into your pages, add a Global Setting named external.api.analytics.premonix? and set the value to false.

Region Wrapper

When you define a content region in a template, the code that you put on the page in that region is inserted at that point in the template. To enable the in-place editing feature, all the code in each region is wrapped in a div with a special class assigned to it, such as:

<div class='wv-code-region-pod_639251'>

In some circumstances, such as if you are using a content region in the head section of your template, or if your layout can't tolerate having the content wrapped in a div, you may need to prevent this from happening.

To do so, simply add the attribute editable="false" to the content statement in the template, such as:

<w:content region="special" editable="false" />

Visual Editor Markup

When you use the Visual Editor, either to directly edit a region or to place content in a field of database item, the Visual Editor provides the markup to implement its interpretation of your intent.

Usually, this markup is fine, but there's nothing like hand coding to retain full control. You can always switch to code view to edit the HTML directly. For custom database item types, you can specify a region as a code region when you define the item type, and then only the code editor will be shown.

One behavior that is sometimes problematic is that content entered in the Visual Editor is always wrapped in a <p> tag. This is sometimes problematic if you have, for example, an excerpt field, and you want to display a "read more" link at the end of the excerpt text, without a line break.

The cleanest solution to this problem, if you can do without any special formatting of the excerpt text, is to simply make the excerpt field a plain text field.

If you need the excerpt to be a Visual Editor field, you can use CSS to turn the <p> tag in the excerpt field into an inline element. On your page, wrap the excerpt and the "read more" link in a div, so you can apply a class to it:

<div class="excerpt">

  <w:excerpt /> <a href="<w:path url='item' />">Read More</a>

Then, in your CSS file, add a rule like:
.excerpt p {display:inline}

One downside of this approach is that any paragraph breaks within the excerpt are effectively ignored, but as long as the excerpt is a single paragraph, it works fine.

The Rest Is Up to You

Webvanta is designed to give you complete control over your front-end code. There are no limitations to what code you can use, and with the exceptions noted above, Webvanta does not modify your code. For each case where Webvanta does inject code, we've provided a mechanism for you to disable it.