admin管理员组文章数量:1317915
I'm making a web app that shows information about a type of truck - if the user wants to view their content in metric or imperial they click the respective box in the header - I want to change the content of the page to reflect the right system - ideally by not using two different subdomains or pages - thanking you
I'm making a web app that shows information about a type of truck - if the user wants to view their content in metric or imperial they click the respective box in the header - I want to change the content of the page to reflect the right system - ideally by not using two different subdomains or pages - thanking you
Share Improve this question asked Oct 31, 2020 at 15:34 Caolán MaguireCaolán Maguire 11 bronze badge 2- Would you just change a table of statistics, or is it paragraphs of text and images too that change? – Rup Commented Nov 1, 2020 at 9:46
- It would be different images and text - what I ended up doing was setting the classname of whatever element to something fixed example "UserRoleOneOnly" and then using javascript Header And Footer Script plugin to have javascript run a check at the end if there are any elements with that classname and to remove them. – Caolán Maguire Commented Nov 28, 2020 at 12:13
1 Answer
Reset to default 0Well, if you don't want to use two pages, then you have two options - load content via AJAX, or use javascript to hide some of the content (for example imperial units related content).
Second option is much more easier in my opinion, but it may slow down your page, so it's not recommended when there is a lot of content.
本文标签: pluginsDisplaying different content depending on variable
版权声明:本文标题:plugins - Displaying different content depending on variable 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742023666a2415146.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论