I'm trying to add a new sub-navigation item to the user account section. Whenever I add the following template modification, the link is generated as /account vs /account/my-custom-account-section. Interestingly, if I browse the page directly, my logic to select the sub-navigation item works properly, but the link still only generates as /account.
Is there something else I need to do to generate the path properly? I am extending the xfcp_account class in my controller, so it should have context to account.
Cheers!
Is there something else I need to do to generate the path properly? I am extending the xfcp_account class in my controller, so it should have context to account.
Code:
<?xml version="1.0" encoding="utf-8"?>
<template_modifications>
<modification type="public" template="account_wrapper" modification_key="my_template_modification" description="Add nav item" execution_order="10" enabled="1" action="preg_replace">
<find><![CDATA[/\<xf:if is="\$xf\.app\.connectedAccountCount\"\>/]]></find>
<replace><![CDATA[<a class="blockLink {{ $pageSelected == 'my_custom_account_section' ? 'is-selected' : '' }}" href="{{ link('account/my-custom-account-section') }}">
{{ phrase('my_custom_account_section') }}
</a>
$0]]></replace>
</modification>
</template_modifications>
Cheers!