Dynamic RTL when application runining

Hello Team

I downloaded the Medtronic v8.1 for asp net core 6

I found that the direction is a key in the "appsettings.json" file, but I'd like the user to dynamically change the direction while the app running, using the "appsettings" I will set the direction only on the app start

any suggestion for this?

many thanks

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (5)

Hi Ahmad,

In theme configuration, you can only set a default direction to switch direction dynamically you will need to store info about the user's selected mode in the session or database. And then inside Starterkit/_keenthemes/KTBootstrapBase.cs inside function initThemeDirection set saved data.

Regards,
Lauris Stepanovs,
Keenthemes Support Team

Thank you, Lauris

The method "initThemeDirection" was invoked on application initialization, if the user changed the direction should I restart the application to load the newly selected value from local storage?

Regards

You will need to refresh a page to load RTL version styles.

Regards,
Lauris Stepanovs,
Keenthemes Support Team

Thank you, Lauris

Got it, so I have to save the whole "KT" object inside "appsettings.json" in local storage ex: SQL Database, then load that info (object contains the name of the RTL version of css files), right?

Many thanks

Hi Ahmad,

Yes, you can store a whole configuration or just separate properties, for example, if you want to remember the user-selected direction you can store the direction value and then overwrite the config property with the stored direction value.

Regards,
Lauris Stepanovs,
Keenthemes Support Team

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(