Customizing login and other account ui MVC
No edit summary
No edit summary
Line 1: Line 1:
The UI that Turnkey and custom built web apps using the MDriven.ASPNETIdentity implementation can be easily overriden by following this strategy.
The UI that Turnkey and custom built web apps using the MDriven.ASPNETIdentity implementation can be easily overriden by following this strategy.


This is explained in the context of MDriven Turnkey - buut will follow the same pattern for other application using MDriven.ASPNETIdentity.
This is explained in the context of MDriven Turnkey - but will follow the same pattern for other application using MDriven.ASPNETIdentity.


# Remember that Account controller has different implementations for MVC4(.net5+) and MVC4 (framework 4.7), the override behaves the same for both controllers (AccountControllerBase and AccountControllerBaseForCore) - but views differ slightly so using core views on framework will probably not be ok and vice versa.
# Remember that Account controller has different implementations for MVC4(.net5+) and MVC4 (framework 4.7), the override behaves the same for both controllers (AccountControllerBase and AccountControllerBaseForCore) - but views differ slightly so using core views on framework will probably not be ok and vice versa.
# The controller has been given a new string property '''AccountOverride''' if this is assigned all account cshtml views will be sought after first in Views/Account/EXT_AccountOverride/<AccountOverride-value>
# The controller has been given a new string property '''AccountOverride''' if this is assigned all account cshtml views will be sought after first in Views/Account/EXT_AccountOverride/<AccountOverride-value>
# If the sought after UI is not found in the override position - the standard position will be used  Views/Account - this is also true if AccoountOverride is null or empty[[File:2022-03-08 18h56 00.png|none|thumb|385x385px]]In the image above the Login and Register has been overriden and will come into play if and only if the AccountController.AccountOverride == "test"
# If the sought after UI is not found in the override position - the standard position will be used  Views/Account - this is also true if AccoountOverride is null or empty[[File:2022-03-08 18h56 00.png|none|thumb|385x385px]]In the image above the Login and Register has been overriden and will come into play if and only if the AccountController.AccountOverride == "test" (since the folder is named test)
# In MDriven Turnkey you give a value to AccountController.AccountOverride by implementing a string  attribute on SysSingleton:[[File:2022-03-08 19h00 12.png|none|thumb|355x355px]]
# In MDriven Turnkey you give a value to AccountController.AccountOverride by implementing a string  attribute on SysSingleton:[[File:2022-03-08 19h00 12.png|none|thumb|355x355px]]
##You can by using different means to give value to SysSingleton.AccountOverride influence what override folder of possibly many (test, consumer, admin , whatever) you want to show to a user interacting with any of the many views of account controller.
##You can by using different means to give value to SysSingleton.AccountOverride influence what override folder of possibly many (test, consumer, admin , whatever) you want to show to a user interacting with any of the many views of the account controller.
#To get the override UI distributed and applied to your server we suggest that you use the [[AssetsTK]] strategy
#To get the override UI distributed and applied to your server we suggest that you use the [[AssetsTK]] strategy



Revision as of 18:12, 8 March 2022

The UI that Turnkey and custom built web apps using the MDriven.ASPNETIdentity implementation can be easily overriden by following this strategy.

This is explained in the context of MDriven Turnkey - but will follow the same pattern for other application using MDriven.ASPNETIdentity.

  1. Remember that Account controller has different implementations for MVC4(.net5+) and MVC4 (framework 4.7), the override behaves the same for both controllers (AccountControllerBase and AccountControllerBaseForCore) - but views differ slightly so using core views on framework will probably not be ok and vice versa.
  2. The controller has been given a new string property AccountOverride if this is assigned all account cshtml views will be sought after first in Views/Account/EXT_AccountOverride/<AccountOverride-value>
  3. If the sought after UI is not found in the override position - the standard position will be used Views/Account - this is also true if AccoountOverride is null or empty
    2022-03-08 18h56 00.png
    In the image above the Login and Register has been overriden and will come into play if and only if the AccountController.AccountOverride == "test" (since the folder is named test)
  4. In MDriven Turnkey you give a value to AccountController.AccountOverride by implementing a string attribute on SysSingleton:
    2022-03-08 19h00 12.png
    1. You can by using different means to give value to SysSingleton.AccountOverride influence what override folder of possibly many (test, consumer, admin , whatever) you want to show to a user interacting with any of the many views of the account controller.
  5. To get the override UI distributed and applied to your server we suggest that you use the AssetsTK strategy

Example:

2022-03-08 19h07 00.png
2022-03-08 19h08 42.png
This page was edited 2 days ago on 05/02/2024. What links here