Hi I am using one theme for the desktop theme and another for the mobile theme(the default). When visitors load the desktop theme i have the default homepage to load the url: '/categories/discussions' (in Appearance-> Homepage). But... This is not ideal in mobile version of the forum. So... How do i code the mobile theme to load '/diskussions' instead?
Answers
Tried a number of tweaks but no luck. I tried to redirect to /discussions via 'mobile theme hooks'. Tried both html (HTTP-EQUIV) and javascript but when the mobile theme loads but then the browser goes in a infinitive loop. There must be a simple solution to this... Please advice.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •just an idea - there probably is an easier way.
maybe you could look at $this->FireEvent("AfterLoadRoutes");
and do some sort of plugin
test if mobile and modify
look at library/core/class.router.php
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Besides peregrine's advice, I still think you're on the right track. Your redirect is working, problem is that it's working at the wrong time (too early).
Redirect... Load Vanilla, which loads the default /categories/discussions/ view => redirect b/c of mobile, etc. => infinite loop.
If you do the tweaking using peregrine's advice, you're closer to your solution.
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Well. My main knowledge strongest platform is WordPress and i am learning Vanilla "as i go". I would be soooo grateful for a code exaple that shows how i can implement the code @peregrine adviced. Can i add the code in my mobile theme file class.mobilethemehooks.php? I added the HTTP-EQUIV there but as @UnderDog states it fires to early...
This is the code i added to class.mobilethemehooks.php that fires to early:
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I cannot help much, but there's a difference between :
public function Base_Render_Before($Sender) {ANDAfterLoadRoutesMaybe it's
public function Base_AfterLoadRoutes($Sender) {or something similar.(with or without Base)
I wish I could help more.
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@peregrine do you think i can use AfterLoadRoutes in class.mobilethemehooks.php? If this is solved i think it would be a great 'How-To' article in the Wiki. I can write the article but i need help with a working code snippet. Anybody else that can help out?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •After experimenting a little - I think the Before and AfterLoadRoutes is too late in the game. I'm no expert at all in .htaccess files, but maybe they will help you
here are some links.
http://stackoverflow.com/questions/3680463/mobile-redirect-using-htaccess
http://stackoverflow.com/questions/9980498/htaccess-mobile-redirect-with-keeping-url-and-ajax-call-filtering
http://wordpress.org/support/topic/how-to-redirect-links-for-mobile-using-htaccess
http://www.webmasterworld.com/apache/4367451.htm
other than that, I'm all out of ideas. sorry.
Maybe an .htaccess expert can tailor it to your needs.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@Todd could you give à hint if what i want to do is event possible? @peregrine @underdog thank you so mutch for your time. I hope i can report back to you with the solution.
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •hope you get a solution - I'd like to see how to do this properly.
It would be kind of cool - also if there was a dashboard setting in configuration that had an option for what you want to do (maybe in a future release).
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Any experts out there. could something be created here -
conf/bootstrap.after.php
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •This one is interesting to figure out and document...
You have to figure out exactly on which moment the /categories/discussions view (or another one) is loaded.
I think you can only do that by looking at debug_backtrace at any given time.
Browse through the lines of debug_backtrace and you'll see at which point that 'homepage' view is loaded.
Let's see if that works...
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I only get the debug info in my dashboard or if there is an error. cleared the cache. change the settings for manage view and debug. Thought I saw it on other pages once - but it too mystifies me as to how to initiate it on all pages.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@underdog and @peregrine Hang on for a few days. A solution is in progress.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Here is my contribution to this problem: http://vanillaforums.org/addon/mobiledefaultroute-plugin I hired x00 to write the community a plugin :-) Enjoy. @x00 thanks. Fast and professional work.
- Spam
- Abuse
- Troll
2 • Off Topic Insightful 2Awesome LOL •Very cool
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •No worries :)
Don't PM about development, I'm not currently taking on clients.
grep is your friend.
- Spam
- Abuse
- Troll
1 • Off Topic Insightful 1Awesome LOL •Thanks guys!
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •the guy deserves a like for sponsoring a plugin don't you think.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •