Using the {get} Merge Tags with [gvlogic] to display a person's name in a Custom Content widget

This walk-through will show you how to use {get} Merge Tags together with the [gvlogic] shortcode.

Here's a quick demonstration

If you learn better with video, here's a quick walk-through:

Add a Custom Content widget

In the Widget area, click "+ Add Widget"

The Add Widget button

Then click the Custom Content widget.

The Custom Content widget in the widget list

and click the gear icon to configure the Widget settings.

The gear icon next to the Custom Content widget label

Add the following content to the widget:

[gvlogic if="{get:first-name}" isnot=""]
  <h3>Hi, {get:first-name}! Welcome to my View!</h3>
[else]
  <h3>Welcome to my View!</h3>
[/gvlogic]<br>
				

What will this do?

If a person's first name is passed in the URL using ?first-name, it will show the person's name in the heading. If ?first-name is not set or is empty, it will show a different heading.

the [gvlogic] shortcode inside the Custom Content text editor

Update the View

Then visit the new View on your site.

The Update button in the View editor

What is visible when there is nothing passed in the URL

The [else] value is used when the {get} value isn't matched.

The browser address bar

When URL parameters are passed

?first-name=Floaty content the URL triggers the {get:first-name} Merge Tag.

Let's take a look at the [gvlogic] shortcode we added to the Custom Content widget. It says if {get:first-name} is not empty, show the following HTML content:  <h3>Hi, {get:first-name}! Welcome to my View!</h3>.

The {get:first-name} content is then replaced with the value passed in the URL: Floaty!

Hi Floaty, welcome to my View
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us