RSS Feed/News Using a variable in a phrase

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
23,652
Points
823

Reputation:

Hi
Is there a way to use a variable inside a phrase?
I mean doing something like this:
I have a list of phrases:
classifieds_listing_field_choice.town_A01
classifieds_listing_field_choice.town_A02
classifieds_listing_field_choice.town_A03

I want to show them in the template using the A0* part which is determined as a variable:
{{ phrase('classifieds_listing_field_choice.town_{$listing.custom_fields.town}) }}
but get a syntax error.
Is there a different way to do this?

Thanks!!

Continue reading...
 
Status
Not open for further replies.
Top