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.
How do i apply the mobile theme to tab?
mahesh
New
Hi
Is it possible to apply the mobile themes to tablet?
0
Comments
Garden (and by extension Vanilla) uses a general function called
IsMobile()
to determine if running a mobile device or not. The theme manager chooses the theme based on the return value.Override the
IsMobile()
function by declaring your custom version in your/conf/bootstrap.before.php
file.For reference, the default
IsMobile()
function is defined in/library/core/functions.general.php
around line 1258.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
now, how in the hell did you know that?
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong. || Plugin Development Explained
IsMobile() function returns the following somewhere.
return $IsMobile;
Where does it return the value?
Where can i find the mobile vs desktop theme changer code?
I don't find bootstrap.before.php in conf folder
create it.
I think they have already answered your other questions.
you can also search for bootstrap on the forum, i know I've answered this question before and so have other people.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Right now, It is going to be mobile or desktop. How do i create new theme for tab? I might need more theme for different device.
How do i do that?
return C(!IsMobile() ? 'Garden.Theme' : 'Garden.MobileTheme', 'default');
return C(!IsMobile() ? 'Garden.Theme' : !isTab() ? 'Garden.MobileTheme' : 'Garden.TabletTheme', 'default');
Where is Garden.Theme and MobileTheme defined?
If I changed that line in functions.general.php and class.thememanager.php, how will it affect the plugins?
see this as reference....
http://vanillaforums.org/discussion/comment/171195/#Comment_171195
I am sorry - I have a low patience level. But perhaps others can help you. So my apologies.
first off - does the word "thank you" exist in your language.
you start multiple threads, but don't pursue them and answer them
read the documentation.
you are asking people questions, how do I, and then they give you advice and then you want them to write the apps for you. I suggest you hire a developer.
you also need to use the "search" box more effectively, it will provide you lots of information.
and please re-read these....
http://vanillaforums.org/discussion/23130/forum-post-ettikett-etiquette
http://vanillaforums.org/discussion/17954/food-for-thought-forum-etiquette
http://vanillaforums.org/discussion/25115/how-to-how-can-a-new-user-better-help-the-community-when-asking-a-question
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
you were already given the suggested way to do things, and now you want to modify the core.
which is not a good idea. we are going in circles.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Multiple threads for same topic?
When did i ask others to write plugin for me?
There are different threads with different questions. I havent got time to workout on them. So, they are still open.
Since you asked, I will add the word 'Thank You' in every my reply
good luck. and I hope you find the time to work on things and i hope you find the search box valuable and that you find time to read the etiquette threads. I won't bother you any more.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
If my previous reply was rude, I am extremely sorry. I didnt mean to be like that. I can see from your reply that you took that that way. English is not my mother tongue.
You have given me links for old threads.
Actually where can i read about bootstrap.before.php?
I can see that creating new theme for tab is possible without touching the core from your reply.
PS: I used to close thread and i used to say thanks in all my threads even before they were answered. Here, In vanilla forums, everything goes wrongly. If i open old thread, i am told that i opened old thread. If i create new topic for existing thread, i am told that i am making duplicates. That is the reason i asked just questions without adding any other extra word.
Apart from everything, Thanks for all your help.
simply put bootstrap.before.php and bootstrap.after.php
that get called before and after the bootstrap program is called
all you have to do is create a file with one line it.
if a function in vanilla core has a line that starts with
it can be overrriden via the booststrap technique specified.
it no simpler or harder than that.
As to side affect of doing things, you can't expect to have an answer of the side affect of you changing a function. no one knows what your change will be. "You" and you alone need to experiment and test the changes you make.
geez - most of your answers can be found by searching. you can still read an old thread without resurrecting it.
http://vanillaforums.org/search?adv=&search=bootstrap.before
The documentation is on the the documentation link, and the wiki, if its not there you may search the forum for information. I'm just saying you don't seem to be reading the answers supplied and start off on new tangents.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
also take a gander in the developer threads.
http://vanillaforums.org/discussion/22107/can-any-function-be-overridden-via-bootstrap
they may prove "insightful" to you.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Any string passed through the
C()
function is looking for a configuration option of that name. It splits.
into sub arrays. In your example,C('Garden.MobileTheme', 'default');
will return the value set in your/conf/config.php
for$Configuration['Garden']['MobileTheme'] = 'mobile';
If the config method can't find anything, it will return false or whatever you pass in as the second argument.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
garden theme is in config.php
mobile theme is
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Yes, I understand that.
I can even successfully override the
IsMobile
function in bootstrap.before.phpI can change it to
theme
ormobile
in bootstrap.before.php.I have create a new theme
tab
in the themes folder.I can detect whether it is mobile or tab or computer in my function.
How do i apply the tab theme to tab viewers?
Thank you!
I extend "you are welcome" from the community.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Honestly, I don't like those buttons.
Moreover, This thread is unsolved!
Yes, I started with applying the mobile theme to tab.
@hgtonight told me the solution for that.
As you can see, I changed my mind, I want to try applying new theme on tab.
But not going to use it so early anyway. Just wanted to try that. I want to know how deep i can extend Vanilla.
So you want a third option for a theme?
The theme manager is pluggable, so you can override it via a plugin.
Untested, but the theory is sound.
We treat positive reactions as acknowledgement of help. Save for donations, reactions keep the regulars going.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I like your idea @hgtonight. maybe he will report back after it is tested and post the entire coding that he used.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.