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.
Options

How to Remove Un-friendly Mobile Plugins from the MobileThemeHooks ?

vrijvlindervrijvlinder Papillon-Sauvage MVP
edited December 2012 in Vanilla 2.0 - 2.8

I would like to know how to selectively remove a specific plugin from loading in the mobile theme.

below is the mobile themehooks php , I would like to know where do I put in the plugin name I want to prevent from loading? My guess is after 'Search' ? .

If I make the plugin itself unfriendly as in MobileFriendly=>'false' I get terminal error... So I assume it's within the theme hooks here that the change needs to be added.

And I also assume that the reverse would apply as in adding a plugin or section deemed unfriendly ?

  
   /**
    * Remove plugins that are not mobile friendly!
    */
   public function Gdn_Dispatcher_AfterAnalyzeRequest_Handler($Sender) {
      // Remove plugins so they don't mess up layout or functionality.
      if (in_array($Sender->Application(), array('vanilla', 'conversations')) || ($Sender->Application() == 'dashboard' && in_array($Sender->Controller(), array('Activity', 'Profile', 'Search')))) {
         Gdn::PluginManager()->RemoveMobileUnfriendlyPlugins();
      }
   }

My problem relates to ExtraPage which is my homepage/Entry for the forum. But it loads as the full site page on mobile. Unless I have to make a mobile version of that page too ? I think just preventing it from loading and open with the discussions is the best thing.

Comments

  • Options
    peregrineperegrine MVP
    edited December 2012

    I would like to know how to selectively remove a specific plugin from loading in the mobile theme.

    the correct way is:

    go to the plugin and look in the description array - remove

    'MobileFriendly' => TRUE,

    or the less appealing

    'MobileFriendly'=> FALSE,


    but the following is just plain incorrect

    /* incorrect syntax */ MobileFriendly=>'false'


    if your device is considered a mobile device the plugin will not show up. period.

    by default extrapage does not have 'MobileFriendly' => TRUE, so it will not show up on mobile devices (assuming the device is considered mobile).

    I'm sure you've seen the other mobile device discussions. :).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    by default extrapage does not have 'MobileFriendly' => TRUE

    Thanks Don Peregrino , I did notice it did not have a 'MobileFriendly' => TRUE however it does show up on the mobile, possibly because I have it set to homepage?

    I know it's the mobile theme because I made it, the page looks like the mobile theme but some content is not compatible with mobile devices so that is why I wanted to selectively not have it show the homepage for the mobile....This may not have to do with the plugin but with the master.tpl ?

    (Yes I did use FALSE in capital letters when I tried it. I assumed it would be that way since the TRUE were in capital letters...thanks for pointing it out though, I hate making mistakes)

    I'm sure you've seen the other mobile device discussions. :).

    You bet I did,that's how I was able to experiment first to know what to try, but none dealt with my specific problem, ExtraPage being my homepage. I am beginning to think I will have to include special css to not display certain content on the ExtraPage for the mobile theme....

  • Options

    if you have a mobile device that is not determined "mobile" like some android devices and ipad you have to add them as discussed in the other discussions.

    If you want your mobile default homepage to be different homepage use this.

    http://vanillaforums.org/addon/mobiledefaultroute-plugin

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Don Peregrino,Usted es mi Idolo ♥ ❤ ❥
    Yes !!! That looks like what I need I will try it out asap.

    I have an iPhone device.

  • Options
    peregrineperegrine MVP
    edited December 2012

    @vrijvlinder said:
    Don Peregrino,Usted es mi Idolo
    Yes !!! That looks like what I need I will try it out asap.

    you will have to thank Don x00 (or would that be Sensei x00 or some other appelation or honorific )for themobile defaultroute-plugin plugin and El sponsor who made it happen :).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

Sign In or Register to comment.