Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
I would like to show table layout for desktops and modern layout for mobiles. Is it possible?
anithaiyer
New
@peregrine suggested this
"you could write a plugin
this should work...
public function Gdn_Dispatcher_AfterControllerCreate_Handler($Sender) {
// change mobile layout to modern if mobile is detected.
if (IsMobile()) {
SaveToConfig('Vanilla.Discussions.Layout','modern', array('Save' => FALSE));
}
}
there may be other ways as well."
Tried it but not working. Don't know where I'm getting it wrong. Any other suggestions?
Tagged:
0
Comments
Please post what you have tried.
added this function inside profile extender's class.profileextender.plugin.php file
and the plugin is already enabled
is not the best description. you could improve on this as far as what you see on desktop, what you see on mobile. what version of vanilla you have, what plugins you have enabled, and what theme you are using for default and what theme you are using for mobile.
I assume you have the following in your conf/config.php
$Configuration['Vanilla']['Discussions']['Layout'] = 'table';
meaning your default setting is Table Layout for discussions.
Several things to keep in mind and general basic rules that I follow.
disable other plugins if necessary while you are testing your new plugin. you may have another plugin that conflicts with it or overrides what you are doing.
this may provide some insights, troubleshooting mysterious problems:
http://vanillaforums.org/discussion/comment/199091/#Comment_199091
you can download
and load this on your computer browser to test.
http://chrispederick.com/work/user-agent-switcher/
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
sorry @peregrine
I tried doing a new plugin too but didn't work
So tried modifying other plugins
Feeling confused