Matt C.
Well-known member
I need to set a default value for the radiorow when adding an entity. I know how to set a default value, but there's just one problem. I'm using the same edit macros for both the add and edit template.
I'm using
Is there a way also set a default fallback value when the user is not on the edit page without creating entirely new macros for the add page?
I'm using
value={$match.platform}
because on the edit page, I need the value to reflect the entity's saved value.
Code:
<xf:radiorow name="platform" value="{$match.platform}" label="{{ phrase('ah_mm_platform') }}">
<xf:option value="PC" label="{{ phrase('ah_mm_pc') }}"></xf:option>
<xf:option value="PlayStation 4" label="{{ phrase('ah_mm_playstation_4') }}"></xf:option>
<xf:option value="Xbox One" label="{{ phrase('ah_mm_xbox_one') }}"></xf:option>
</xf:radiorow>
Is there a way also set a default fallback value when the user is not on the edit page without creating entirely new macros for the add page?