Client URL

Component ID

1210276

Component name

Client URL

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

544

Component created

Component changed

Component body

Occasionally, you need to show a client several different color options for a page or highlight a particular element in a layout for a customer, but you don't want any other users to see those changes. This module allows you to do all of that and more, by modifying css based on a URL.

Here's how it works: by adding a special query string to your URL, you can assign a css class to a particular target element(s) within the page. You then add an additional rule to your theme's css file for the new class, which adds (or overrides) css styles for the target element; this rule could add a highlight color, show an alternate background color, or unhide a form element. You can send your client the modified URL and only they will be able to see the new css you've added.

Examples

Add a class called "client" to a target element called "field-of-interest" on the home page:
http://mysite.com?client_target=.field-of-interest

Add a class called "client" to a target element called "field-of-interest" on the home page AND scroll to that section of the page:
http://mysite.com?client_target=.field-of-interest&client_scrollto=true

Do all of the above, but use a shortcut instead, so that the URL is shorter:
http://mysite.com?client=interest

Features

  • Option to automatically scroll to the section of the page containing your target element (useful for long pages).
  • Shortcuts for frequently used Client URLs. This allows you to use a short URL like http://yoursite.com?client=blue in place of a URL with a much longer query string.
  • Can override the class name that's added (by default the class name is "client").
  • Can override all module settings from the URL query string (or from a shortcut).

Use Cases

  • Show a client an alternate color or font.
  • Show a client a hidden element on the page.
  • Highlight a particular row in a views table.
  • HIghlight a particular section of a policy page for a customer to read.
  • Show a customer a particular FAQ item.