We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22840
    • 1,572 Posts
    Hello again ;o)

    I need to create a tv so that it would have a number of select buttons, then when the client selects them when creating a page it will show a image on the front end, but if there not selected it wont display anything.

    Is this possible or would it take allot of coding ??

    Cheers
      • 5340
      • 1,624 Posts
      It’s easy

      Create a TV showStuff, select Checkbox for Input Type.
      Input Option Values: Select to show stuff==yes

      In your template use phx

      [+phx:if=`[*showStuff*]`:is=`yes`:then=`{ {Chunk} }`+]


      Anyway, it’s not tested but it should work

        • 22840
        • 1,572 Posts
        Hi Cipa,

        thanks for replying.

        Not really understanding this .....

        If I do the Above will it only display the selected options, also how do I create the options for the TV so I only have to create the One TV and do I have to install PHX ??

        Cheers

        Paul
          • 5340
          • 1,624 Posts
          Hi paulp

          Please be more specific about exactly what you want to achieve. I might give you better instructions.

          For example:

          1. Name of your TV
          2. What do you understand by button. Is a checkbox enough?
          3. Do you understand chunks?
          4. Anything else that comes to mind and might help to give you more specific instructions

          also

          In Evo phx is installed by default. Not sure about older versions.

            • 22840
            • 1,572 Posts
            Hi Cipa,

            Right heres the lowdown lol

            I’m building a directory of Campsites and I want the ability to add a selection of amenities to each one by simply selecting them when creating the page on them.

            So for example I would have 3 amenities as follows, Toilets, shop, pool

            Now the way I want to set it up is that when I create the page I will have select buttons or checkbox’s at the bottom as TV’s and if one site only had toilets and a shop I would only select these and only these would show on the main site, if site 2 had all the above then I would select them all and all 3 would show.

            Im going to display them as images so I need to say if toilets is selected display toilets.gif if not display nothing.

            I think that’s the correct way of describing it

            I’m using the latest release and understand chunks ect ( built over 100 sites im modx ) but this is the first time I have tried to do something like this so any help would be fantastic.

            Thanks for your time on this and trying with a no brainer like me grin
              • 26931
              • 2,314 Posts
              Hey Paul,

              in that case...setup a new TV with:

              Input Type: Check Box (or Listbox Multi Select)
              Input Option Values: Toilets=={{imgToilet}}||Shop=={{imgShop}}||Pool=={{imgPool}}

              the Chunks contain the html for those images: {{imgPool}} contains <img src="pathtopool/pool.jpg" alt="" />

              so, if you check one of those options the corresponding image will be displayed, if nothing is checked, there will be no output at all.
              You could also set a "Default Value" value for your TV, if you want one of those images being preselected

              hope i could help smiley j
                • 4385
                • 372 Posts
                How many amenities do you have? You could create a page for each one and keep them in a container called amenities. You then could have Title, short description, long description, photo, icon, etc. You can still create a list of checkboxes to assign amenities to each campsite.
                  DropboxUploader -- Upload files to a Dropbox account.
                  DIG -- Dynamic Image Generator
                  gus -- Google URL Shortener
                  makeQR -- Uses google chart api to make QR codes.
                  MODxTweeter -- Update your twitter status on publish.
                  • 5340
                  • 1,624 Posts
                  Good point bwente.

                  There is no need for PHx in this case.
                    • 22840
                    • 1,572 Posts
                    Quote from: sharkbait at Sep 12, 2009, 05:36 AM

                    Hey Paul,

                    in that case...setup a new TV with:

                    Input Type: Check Box (or Listbox Multi Select)
                    Input Option Values: Toilets=={{imgToilet}}||Shop=={{imgShop}}||Pool=={{imgPool}}

                    the Chunks contain the html for those images: {{imgPool}} contains <img src="pathtopool/pool.jpg" alt="" />

                    so, if you check one of those options the corresponding image will be displayed, if nothing is checked, there will be no output at all.
                    You could also set a "Default Value" value for your TV, if you want one of those images being preselected

                    hope i could help smiley j

                    Have just tried the above but nothing is getting pulled through,
                    The tv is called onsite and the select box’s are showing when I create the page, but no matter what I select I cant get anything to show. Im calling the tv in a chunk with all the other site details ( that are showing ) using [+onsite+]

                    The onsite tv contains Toilets=={{imgToilet}}||Shop=={{imgShop}}||Pool=={{imgPool}} and is a checkbox.

                    {{imgPool}} chunk etc just contain the word at the moment for testing

                    Any pointers would be great

                    Thanks for the time spent on this
                      • 22840
                      • 1,572 Posts
                      Quote from: bwente at Sep 12, 2009, 08:34 AM

                      How many amenities do you have? You could create a page for each one and keep them in a container called amenities. You then could have Title, short description, long description, photo, icon, etc. You can still create a list of checkboxes to assign amenities to each campsite.
                      Thanks for that but I would like to get away from having them as pages as the site is already getting into the few thousand page area.

                      I like the thought of just having them as chunks as it’s dead easy to just add a new one and I’m not hogging up the document tree ( will have somewhere in the region of about 30 eventually.