Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

RTL Switching on runtime in Blazor


Hi,

I'm customizing the UI as per my requirements. Now, I want to change the LTR to RTL at runtime. I found that themesetting.json can do that switching. But It doesn't do on runtime. How can I make it? Please give me complete instructions for this problem.

It would be a great thing if you responded with this question.

Regards
Nabeeh T


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 (3)


Hi,

Thank you for reaching out to us.

In themessetting.json you can set a default theme mode if you want to switch mode dynamically you should use KTTheme.SetDirection("RTL").

Please keep in mind, that this value will be overridden with value from config on page refresh to have the selected mode you need to store the user's selected mode in the cookies or your database and then inside Starterkit/_keenthemes/KTBootstrapBase.cs inside function initThemeDirection you can set saved value.

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Hello,

Thank You for your attention.

I already tried this by using KTTheme.SetDirection("RTL"). I'm little confused about changing the UI at runtime. It didn't trigger the initThemeDirection. What I want to do now!? I already said that am a Noobie in blazor. So, please reply with detailed answers with Attatchment if it is possible.

Regards,
Nabeeh T



Hi,

Sorry for the late reply.

The initThemeDirection is triggered on page refresh and by default it sets direction from theme configuration. You can reuse this function and when user changes direction you can write user's selected direction to the session and then set the direction from the session in this function.

Do you have any errors when you are using KTTheme.SetDirection?

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  :(