We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    I'm trying to show a TV on all parent pages of id 30 and 31.
    Other pages the TV needs to be hidden.
    The below doesn't work. Whats wrong?

    I think this part isn't correct:
    || $content['parent'] != 31)

    because this works:
    if($content['parent'] != 30) {

    Doesn't work:
    
    mm_createTab('Extra', 'extra', '', '', '', '100%');
    mm_moveFieldsToTab('e-image', 'extra');
    mm_moveFieldsToTab('youtube', 'extra');
    
    if($content['parent'] != 30 || $content['parent'] != 31) {
    	mm_hidefields('e-image');
    	mm_hidefields('youtube');
    }
    
    


    This works??!!! but I need it other way arround (visible on the parent ids)
    if($content['parent'] == 30 || $content['parent'] == 31) {
    [ed. note: fourroses666 last edited this post 11 years, 6 months ago.]
      Evolution user, I like the back-end speed and simplicity smiley
      • 2762
      • 1,198 Posts
      Try this:

      // Show youtube and e-image Tvs only for all docs whose parent is id 30 or 31
      switch($content['parent']) {
          case !30:
          case !31:
              mm_hideFields('youtube,e-image');
              break;
          default:
              null;
              break;
      }
      
      
      
      
        Free MODx Graphic resources and Templates www.tattoocms.it
        -----------------------------------------------------

        MODx IT  www.modx.it
        -----------------------------------------------------

        bubuna.com - Web & Multimedia Design
        • 9995
        • 1,613 Posts
        Hm, weird, then its visible on every subpage, and hidden on every root page! X-)
          Evolution user, I like the back-end speed and simplicity smiley
          • 9995
          • 1,613 Posts
          Hmm seems his works.. weird:

          if($content['parent'] == 30 || $content['parent'] == 31) {
          	mm_widget_evogallery('5','Fotoboek','','');
          }
          
            Evolution user, I like the back-end speed and simplicity smiley
            • 9995
            • 1,613 Posts
            This doesn't
            if($content['parent'] != 30 || $content['parent'] != 31) {
            ...
            }

            As soon as using != then this doesn't work.
            Is it a ManagerManager bug?
              Evolution user, I like the back-end speed and simplicity smiley
              • 2762
              • 1,198 Posts
              Yes, i think it's a bug with !=, doesn't work in Manager Manager
                Free MODx Graphic resources and Templates www.tattoocms.it
                -----------------------------------------------------

                MODx IT  www.modx.it
                -----------------------------------------------------

                bubuna.com - Web & Multimedia Design
                • 9995
                • 1,613 Posts
                Grrr
                  Evolution user, I like the back-end speed and simplicity smiley
                  • 25491
                  • 6 Posts