Blog Sections Open

Running Different Snippets for Different Web User Groups

If wholesale and retail users need different storefront behavior, the cleanest solution is to branch rendering by web group instead of cloning the entire page.

Evolution CMS projects often need different logic for different authenticated user groups: wholesale customers may see one cart flow, while retail customers see another. The key is to switch behavior at the snippet level.

One simple pattern

If you already use Personalize, you can keep the decision in the template and send users to different snippet calls based on group membership.

[[Personalize?
  &webGroups=`wholesale`
  &then=`[!Shopkeeper? &mode=`wholesale`!]`
  &else=`[!Shopkeeper? &mode=`retail`!]`
]]

Why this works well

  • one page template stays responsible for layout
  • group-specific behavior stays isolated in snippets
  • you can extend the same pattern to prices, forms, or navigation

When to move logic deeper

If the differences grow too large, move the branching into a wrapper snippet or service layer instead of making the template harder to maintain.

Recommendation

Use web groups as a routing signal for presentation and business logic, but keep the switch centralized so that the project does not turn into two duplicated storefronts.

Newer post

Outputting a TV Label and Value Only When the TV Is Filled

If a TV may be empty, wrap the whole row or list item in a condition so that the label and the value disappear together.

Older post

Checking Whether a TV Field Is Empty with IF

When a TV looks filled in direct output but fails inside IF, the usual problem is how the condition is written, not the TV itself.