{"__v":6,"_id":"56f45bb8cb0dce29005a8e86","category":{"project":"568af724176a6c0d00a29ec4","version":"568af725176a6c0d00a29ec7","_id":"56f45babcb0dce29005a8e85","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-03-24T21:27:07.645Z","from_sync":false,"order":5,"slug":"advanced-use-configuration","title":"Advanced Use & Configuration"},"parentDoc":null,"project":"568af724176a6c0d00a29ec4","user":"568af6d197d8960d0012ab7d","version":{"__v":9,"_id":"568af725176a6c0d00a29ec7","project":"568af724176a6c0d00a29ec4","createdAt":"2016-01-04T22:50:13.289Z","releaseDate":"2016-01-04T22:50:13.289Z","categories":["568af725176a6c0d00a29ec8","56d9d397337fd11300d6a3e3","56d9d4287222d50b0070160b","56f424307ea0091700f63ac5","56f45babcb0dce29005a8e85","5739e5836c5ba134007a197d","57717aee3dd24019004c9122","5771b5d8c755ca0e00617d7d","579639964913990e001a5911"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"createdAt":"2016-03-24T21:27:20.260Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"Sometimes it’s useful to configure the VigLink JavaScript Library differently for a certain page on your site, or even for just part of a page. For example, you might have VigLink Insert enabled on your site, but have an area where links should never be inserted.\n\nVigLink behavior can be configured by adding certain labels (called CSS “classes”) to your site’s HTML.\n\n##**Classes**\n**nolinks**\nWhen VigLink Insert is enabled in your settings, nolinks can be used to ensure links are never added to specific parts of a page.\n**nooptimize**\nIf link optimization is enabled, use nooptimize to ensure certain links are never optimized.\n**norewrite**\nVigLink should completely ignore this part of the page. Links will not be inserted, monetized, etc.\n\n##**Examples**\nPrevent a single link from being monetized…\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<a href=\\\"http://example.com\\\" class=\\\"norewrite\\\">VigLink ignores this</a>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\n…or a whole bunch of them:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" <div class=\\\"norewrite\\\">\\nNone of these links will be monetized by VigLink. Not\\n   <a href=\\\"http://example.com/1\\\">this one</a>, or\\n   even <a href=\\\"http://example.com/2\\\">that one</a>.</div>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nPrevent link insertion in part of the page:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" <div class=\\\"nolinks\\\">\\nMy Nikon D7000 is amazing! VigLink will not insert a link on the text Nikon D7000.</div>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nThese classes can be used anywhere in your HTML and affect everything below. That means an entire page can be configured by adding one to the tag:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"</header>\\n<body class=\\\"nolinks\\\">\\n  <div>Everything within the body will have no links inserted by VigLink Insert.\\n    <p>Even child elements won't have anything inserted on product mentions like Nikon D7000</p>\\n  </div>\\n</body>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\nIf your HTML already has another class where you’d like to use one of ours, just add a space between them. They’ll both work as expected:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<div class=\\\"myclass nolinks\\\">\\nMy Nikon D7000 is amazing! VigLink will not insert a link on the text Nikon D7000.</div>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"configuration-with-html","type":"basic","title":"Configuration with HTML"}

Configuration with HTML


Sometimes it’s useful to configure the VigLink JavaScript Library differently for a certain page on your site, or even for just part of a page. For example, you might have VigLink Insert enabled on your site, but have an area where links should never be inserted. VigLink behavior can be configured by adding certain labels (called CSS “classes”) to your site’s HTML. ##**Classes** **nolinks** When VigLink Insert is enabled in your settings, nolinks can be used to ensure links are never added to specific parts of a page. **nooptimize** If link optimization is enabled, use nooptimize to ensure certain links are never optimized. **norewrite** VigLink should completely ignore this part of the page. Links will not be inserted, monetized, etc. ##**Examples** Prevent a single link from being monetized… [block:code] { "codes": [ { "code": "<a href=\"http://example.com\" class=\"norewrite\">VigLink ignores this</a>", "language": "html" } ] } [/block] …or a whole bunch of them: [block:code] { "codes": [ { "code": " <div class=\"norewrite\">\nNone of these links will be monetized by VigLink. Not\n <a href=\"http://example.com/1\">this one</a>, or\n even <a href=\"http://example.com/2\">that one</a>.</div>", "language": "html" } ] } [/block] Prevent link insertion in part of the page: [block:code] { "codes": [ { "code": " <div class=\"nolinks\">\nMy Nikon D7000 is amazing! VigLink will not insert a link on the text Nikon D7000.</div>", "language": "html" } ] } [/block] These classes can be used anywhere in your HTML and affect everything below. That means an entire page can be configured by adding one to the tag: [block:code] { "codes": [ { "code": "</header>\n<body class=\"nolinks\">\n <div>Everything within the body will have no links inserted by VigLink Insert.\n <p>Even child elements won't have anything inserted on product mentions like Nikon D7000</p>\n </div>\n</body>", "language": "html" } ] } [/block] If your HTML already has another class where you’d like to use one of ours, just add a space between them. They’ll both work as expected: [block:code] { "codes": [ { "code": "<div class=\"myclass nolinks\">\nMy Nikon D7000 is amazing! VigLink will not insert a link on the text Nikon D7000.</div>", "language": "html" } ] } [/block]