We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8615
    • 4 Posts
    Hey Guys,

    i want to exclude a few pictures from my big Gallery-Database and i don’t want to use &pic_query_ids to list the image i want to.
    Hope u understand what i mean laugh
      • 7923
      • 4,213 Posts
      There is the "hide" field.. but that hides the pictures in all galleries.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 8615
        • 4 Posts
        hi doze,
        thx for your answer..
        but unfortunately i want to show the hidden pictures with &pic_query_ids in another gallery :-/
          • 17851
          • 213 Posts
          Any updates on this? I have a real estate property page with "tabs" that hide/show div elements. One tab shows normal pics of the property, and another tab shows floorplans. Is there a way to filter photos from a single gallery by using the custom fields that come with the latest version?
            Mark Macatee
            President
            Power 10 Solutions
            http://www.power10solutions.com
            • 7923
            • 4,213 Posts
            well you could do a custom field that is a checkbox or taglist or what ever. then in your templates, you could use phx conditionals to check if the field value is what you want and either show the picture or don’t.


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 17851
              • 213 Posts
              ah, nice. that’s easier than what I came up with, which was a snippet that queries the db and looks for the customfield that matches. the output of the query was a comma-delimited list of picture id’s. i’ll give that a shot.

              on a related note, I know that custom fields are text. If I want to use a custom field that is yes/no, I should be able to use a checkbox for the display in the MG manager, shouldn’t I? For example:
              <input type="checkbox"
              name="[+maxigallery.fieldnames.myfieldname+]"
              value="yes"
              onClick="document.editform.[+maxigallery.fieldnames.modified+].value='yes'"
              [+maxigallery.picture.myfieldname:is=`yes`:then=`checked="checked"`+]/>
              

              This displays the DB value properly, but I’ve had problems saving any changes to it. In looking at the code, it looks like it should read this.
                Mark Macatee
                President
                Power 10 Solutions
                http://www.power10solutions.com
                • 7923
                • 4,213 Posts
                Yes, checkboxes should work... but if they don’t you can make it as hidden field and do javascript to the "onclick" attribute of the checkbox that sets the value of the hidden input field..


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 1266
                  • 50 Posts
                  Quote from: doze at Mar 13, 2010, 11:03 AM

                  well you could do a custom field that is a checkbox or taglist or what ever. then in your templates, you could use phx conditionals to check if the field value is what you want and either show the picture or don’t.

                  Would you do this in the galleryOuterTpl or the galleryPictureTpl? I’m not sure exactly what’s in [+maxigallery.pictures+], so I’m not sure how to filter it from the gallery wrapper level (which seems more intuitive than making the image template to decide to display it or not). Thanks in advance.
                    • 7923
                    • 4,213 Posts
                    [+maxigallery.pictures+] has the content from galleryPictureTpl after all pictures for the page are processed.

                    So do it in the galleryPictureTpl, eg.

                    [+maxigallery.picture.yourcustomfield:is=`cars`:then=`

                    template content here

                    `+]

                    That should show only pictures where yourcustomfield has the value of cars.


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 1266
                      • 50 Posts
                      great! the filtering is working once I made the appropriate changes to the template.

                      An unforeseen result though - because the filtering is done at the image level, the pagination is still based on [+maxigallery.pagecount+], so it will lead to pagination and empty pages if you’re retrieving a bunch of photos, but only displaying a few.

                      Might there be a workaround without going into the code?