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
    My slider doesn't work with only 1 item, so I need to show another item and hide the arrows (add some css) to get it to work when 1 item is being uploaded into multiTV.

    Maybe with phx its possible to count items and output something else?

      Evolution user, I like the back-end speed and simplicity smiley
    • multiTV has an rows.total placeholder in outerTpl that could be used for that (https://github.com/Jako/multiTV#placeholder-outertpl).

      [+rows.total:eq=`1`:then=`xxx`:else=`yyy`+]

        • 9995
        • 1,613 Posts
        Thanks Jako, that did the trick for me!
          Evolution user, I like the back-end speed and simplicity smiley
          • 21417
          • 486 Posts
          Thanks Jako, that's awesome - I have always wanted to hide the paging buttons when only one slide exists in MultiTV slideshows but never knew how to do it.

          This works a treat in the MultiTV wrapper template:
          [+rows.total:gt=`1`:then=`<div id="slider-pager"></div>`:else=``+]

          Thanks.
            Web design Adelaide
            http://gocreate.com.au
            • 9995
            • 1,613 Posts
            Grr,

            I need when empty then show x (x = <img scr="empty.jpg" />) else show y (y = multitv)
            I tried everything but can't get it to work.

            PHX:
            if (!class_exists('PHxParser')) {
                include MODX_BASE_PATH . "assets/plugins/phx/phx.parser.class.inc.php";
            }
            
            $e = &$modx->Event;
            switch($e->name) {
                case 'OnParseDocument':
                    $PHx = new PHxParser($phxdebug,$phxmaxpass);
                    $PHx->OnParseDocument();
                    break;
            }


            MultiTV:
            [!multiTV?
                &tvName=`banner`
                &docid=`[*id*]`
                &outerTpl=`slider-outer`
                &rowTpl=`slider-row`
                &display=`all`
                &rows=`all`
                &toPlaceholder=`0`
                &randomize=`0`
                &published=`1`
                &emptyOutput=`0`
            !]


            Modx version: 1.0.13.rc2

            Tried:
            &emptyOutput=`1`

            [*banner:ne=``:then=`not empty`*]
            [+banner:ne=``:then=`not empty`+]


            (placed multitv modifier in phx plugin map)
            [+phx:multitvisempty=`banner`:then=`xxx`:else=`yyy`+] 
            [+phx:multitvisnotempty=`banner`:then=`xxx`:else=`yyy`+]


              Evolution user, I like the back-end speed and simplicity smiley
            • The easiest/hassle free way in my opinion would be inside of multiTV by using emptyOutput and a PHx construct in the outer template.
              &emptyOutput=`0` &outerTpl=`tplOuter`


              tplOuter
              [+wrapper:ne=``:then=`[+wrapper+]`:else=`<img scr="empty.jpg" />`+]
              [ed. note: Jako last edited this post 10 years, 2 months ago.]
                • 9995
                • 1,613 Posts
                Hmm, the slider script let me think it didn't work..

                Thanks, would be nice to add a &emptyRowTpl=`` function. [ed. note: fourroses666 last edited this post 10 years, 2 months ago.]
                  Evolution user, I like the back-end speed and simplicity smiley
                • Do you want to get <img scr="empty.jpg" /> if there is no content in the multiTV?

                  Should work with the parameters above.
                    • 9995
                    • 1,613 Posts
                    True, but I would like it better that way.
                    Or to say it some nicer, would be a nice feature. [ed. note: fourroses666 last edited this post 10 years, 2 months ago.]
                      Evolution user, I like the back-end speed and simplicity smiley
                    • Updated multiTV to 1.8.1:
                      - noResults parameter added