Our conditional content block makes it possible to display different content depending on different parameters such as URL parameters, cookies, time, post type or user roles. This way, you can display different contents for example for users that come from a newsletter and users that come from Google. And you won’t even need code to do that! Learn here how it works.
How can I personalize my website content?
Hi, this is Sandra from GREYD. In this video I am going to show you how to make your content dynamic with our conditional content block. With this block you’ll be able to show your visitors different contents depending on certain parameters like how, when and from where a visitor gets to your website. You could for example show different prices on your site depending on whether someone comes from Google or is already a newsletter subscriber. Or you could also display different support forms depending on the current time, for example with different service levels or contact persons thereby easily managing a 24/7 support without coding. To make your content dynamic, start with adding the block conditional content to your website.
Now you can define one or several conditions. Here on the right at first decide on whether all parameters which you will define now have to be true – which would be “and” – or whether it’s sufficient if one of them is true – which would be an “or” condition. When you now define your conditions, please make sure not to create any contradicting conditions.
As an example I’d like to display different welcome texts depending on whether a website visitor is an admin or not. Therefore I use “user role” as the condition and set it to “is administrator”.
Now I put the content into the container that is to be displayed for this condition.
Then I do the same for “is not admin”, so I just copy the entire block and change the content and condition.
Let’s check the result in the frontend. This is how the page looked before. When I now refresh, I should be greated with the admin text as I am an admin. And it worked! According to the same principle, you can also vary your content depending on URL parameters and cookies.
You can work with various Google campaign parameters or also with form parameters, for example to show visitors different content depending on whether they have just confirmed a double opt-in or maybe clicked an opt-out link. You can also take a look at the default thank you page, which comes with every GREYD.SUITE installation. On this page, we have used exactly this feature and condition. And of course you can also define your own parameters that you use for example in newsletter links. I’d like now to present a special price to all visitors coming from my newsletter and also a different image, so I select “URL parameter” as a condition, set it to “individual” and name my parameter “newsletter”. So let’s just change the content, for the example different text, another image, this one I’m just going to delete, and then update the website.
If I now refresh my website, I don’t see anything. Why? I’ve just set the condition for “is newsletter”, which is currently not true. So nothing is shown. But if I now change the URL and include my newsletter source parameter, my new content is visible. With this, you can save a lot of time since you don’t have to build your pages several times and just make your content dynamic with our conditional content block. This also works with time as a condition.
And before we finish, a tip from me: This debug mode here is very handy to test your conditions as it tells you why certain content is displayed or not displayed. So let’s just activate it and refresh the page. Here it now says the parameter has to be “newsletter” for the content to be shown and it is true, so my content is shown. And if we try exactly the same and delete the URL parameter before, we will see that the debug mode exactly informs us what happens. So let’s just delete it here, refresh the page. Exactly: Here it says “URL parameter has to be newsletter source”, but it’s false because there’s no parameter set. You only need to make sure that the debug mode is disabled again before publishing your website.
For more videos and information please visit our Helpcenter.
Was this article helpful?