Toggle effect logic in template on category