We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
      Ok, this is your happy day if you’re a css-lover (I hate it, btw) and are using MaxiGallery snippet. Here’s a "preview" of the next version (v0.5). This should do everything that v0.4.1 does, but has templating ability as extra. And... ...NO tables, yay!

      So go and get it here!

      Changes to the parameters

      Removed:
      [list]
    • display_manage - if you don’t want "manage pictures" to show, make a custom template and don’t put it’s placeholder to the template
    • use_charset - htmlentities conversion is not done in the snippet code anymore, templates uses phx to convert picture titles/descriptions to htmlentities. Slidebox xml uses the charset setting from modx.
    • only_page_numbers - if you don’t want next / prev links, don’t put their placeholders in your template
    • childgalleries_title_field - in child gallery template, there are placeholders for every modx document object field

    Meaning changed

    • pics_per_row - as the gallery over view is not built in to a table anymore (unless you make it so grin), there are many ways to define how many pictures will be in a row. You can either set the max width in css of the div that contains the pictures or use this parameter. By setting this to 3 for example will result that after every 3 images in gallery overview, the contents of clearerTpl is outputted to the page. In default templates that template has br tag that has clear:both set in it.

    New parameters:

    • &debug - Shows some debug information (feature not fully implemented yet). Possible values [ 0 | 1 ].
    • &lang - Sets the gallery language via parameter. Language files not fully updated yet. Possible values [ en | fr | es | fi | addyourown ].
    • &view_gallery - Shows a gallery from some other document. Possible values [ document id ].
    • &manageOuterTpl - The outer template for gallery management. Possible values [ path to a file | chunk name | or template content as string ].
    • &managePictureTpl - The template for single picture element in the gallery management. Possible values [ path to a file | chunk name | or template content as string ].
    • &manageUploadTpl - The template for the file upload rows in gallery management. Possible values [ path to a file | chunk name | or template content as string ].
    • &galleryOuterTpl - The outer template for the gallery overview. Possible values [ path to a file | chunk name | or template content as string ].
    • &galleryPictureTpl - The template for single picture element in the gallery overview. Possible values [ path to a file | chunk name | or template content as string ].
    • &childgalleryPictureTpl - The template for single child gallery element in the gallery overview. Possible values [ path to a file | chunk name | or template content as string ].
    • &pictureTpl - The template for the picture view. Possible values [ path to a file | chunk name | or template content as string ].
    • &clearerTpl - The template to use when using &pics_per_row parameter as a row clearer
    • &pageNumberTpl - The template for page numbers in gallery overview
    • &css - css styles to add to the page head. Possible values [ path to a file (will be added as css link to the html source) | chunk name (use <style..></style> tags in the chunk) | or css content as string (use <style..></style> tags) ].
    • &js - extra javascript to be added to the page head. Possible values [ path to a file (will be added as js link to the html source) | chunk name (use <script..></script> tags in the chunk) | or css content as string (use <script..></script> tags) ].

    Available placeholders

    manageOuterTpl
    Look for the default content in: assets/snippets/maxigallery/templates/manageoutertpl.html

    [+maxigallery.messages+] = Error messages / notices in the picture management (that comes from the language file).
    [+maxigallery.urlback+] = Url to the "back to normal view" link
    [+maxigallery.urlaction+] = Form action url
    [+maxigallery.managepictures+] = the pictures (content from managePictureTpl)
    [+maxigallery.uploadpictures+] = the picture upload fields (content from manageUploadTpl)
    [+maxigallery.hiddenfields+] = hidden fields for the picture management form that needs to be in it
    [+maxigallery.pageinfo.fieldname+] = MODx document object fields from the gallery document where. The "fieldname" would be pagetitle, longtitle, pub_date, etc..
    [+maxigallery.strings.keyname+] = Texts from the MaxiGallery language file. The "keyname" would be click_to_zoom, previous, next, etc..

    managePictureTpl
    Look for the default content in: assets/snippets/maxigallery/templates/managepicturetpl.html

    [+maxigallery.picture.fieldname+] = Content from MaxiGallery picture fields. The "fieldname" can be id, gal_id, filename, title, date, descr, pos or own_id.
    [+maxigallery.path_to_gal+] = the path where the current gallery images are. eg. assets/galleries/120/
    [+maxigallery.fieldnames.field+] = The names for the form input fields. The "field" can be delete, position, title, pictureid, modified and description. Look a the default template how these are used.
    [+maxigallery.strings.keyname+] = Texts from the MaxiGallery language file. The "keyname" would be click_to_zoom, previous, next, etc..

    manageUploadTpl
    Look for the default content in: assets/snippets/maxigallery/templates/manageuploadtpl.html

    [+maxigallery.counter+] = Number for the current row
    [+maxigallery.fieldnames.file+] = Name for the form input field

    galleryOuterTpl
    Look for the default content in: assets/snippets/maxigallery/templates/galleryoutertpl.html

    [+maxigallery.managebutton+] = Button for the picture management
    [+maxigallery.childgalleries+] = Child galleries (content from childgalleryPictureTpl)
    [+maxigallery.pagenumber+] = Current page number
    [+maxigallery.pagecount+] = Total number of pages
    [+maxigallery.previous_page_url+] = Url for the previous page link
    [+maxigallery.next_page_url+] = Url for the next page link
    [+maxigallery.pagenumbers+] = Page numbers (content from pageNumberTpl)
    [+maxigallery.pictures+] = Gallery pictures (content from galleryPictureTpl)
    [+maxigallery.pageinfo.fieldname+] = MODx document object fields from the gallery document where. The "fieldname" would be pagetitle, longtitle, pub_date, etc..
    [+maxigallery.strings.keyname+] = Texts from the MaxiGallery language file. The "keyname" would be click_to_zoom, previous, next, etc..

    galleryPictureTpl
    Look for the default content in: assets/snippets/maxigallery/templates/gallerypicturetpl.html

    [+maxigallery.embedtype+] = MaxiGallery embedtype configuration setting value
    [+maxigallery.picture.fieldname+] = Content from MaxiGallery picture fields. The "fieldname" can be id, gal_id, filename, title, date, descr, pos or own_id.
    [+maxigallery.path_to_gal+] = the path where the current gallery images are. eg. assets/galleries/120/
    [+maxigallery.picture_link_url+] = Url for the link from the picture
    [+maxigallery.big_pic_exists+] = Indication that does the big picture exist. 1 for yes, 0 for no.
    [+maxigallery.picture_height_big+] = Heigth of the big picture
    [+maxigallery.picture_width_big+] = Width of the big picture
    [+maxigallery.picture_height_normal+] = Heigth of the normal picture
    [+maxigallery.picture_width_normal+] = Width of the normal picture
    [+maxigallery.picture_height_thumb+] = Heigth of the thumbnail picture
    [+maxigallery.picture_width_thumb+] = Width of the thumbnail picture

    childgalleryPictureTpl
    Look for the default content in: assets/snippets/maxigallery/templates/childgallerytpl.html

    [+maxigallery.pageinfo.fieldname+] = MODx document object fields from the child gallery document where. The "fieldname" would be pagetitle, longtitle, pub_date, etc..
    [+maxigallery.strings.keyname+] = Texts from the MaxiGallery language file. The "keyname" would be click_to_zoom, previous, next, etc..
    [+maxigallery.picture.fieldname+] = Content from MaxiGallery picture fields (from the first picture in the child gallery). The "fieldname" can be id, gal_id, filename, title, date, descr, pos or own_id.
    [+maxigallery.childurl+] = Url to the child gallery document.
    [+maxigallery.path_to_gal+] = the path where the current gallery images are. eg. assets/galleries/120/

    pictureTpl
    Look for the default content in: assets/snippets/maxigallery/templates/picturetpl.html

    [+maxigallery.pageinfo.fieldname+] = MODx document object fields from the gallery document where. The "fieldname" would be pagetitle, longtitle, pub_date, etc..
    [+maxigallery.strings.keyname+] = Texts from the MaxiGallery language file. The "keyname" would be click_to_zoom, previous, next, etc..
    [+maxigallery.big_img_linkstyle+] = MaxiGallery big_img_linkstyle configuration setting value
    [+maxigallery.keep_bigimg+] = MaxiGallery keep_bigimg configuration setting value
    [+maxigallery.path_to_gal+] = the path where the current gallery images are. eg. assets/galleries/120/
    [+maxigallery.picture.fieldname+] = Content from MaxiGallery picture fields. The "fieldname" can be id, gal_id, filename, title, date, descr, pos or own_id.
    [+maxigallery.counter+] = Current picture number
    [+maxigallery.total_pics_count+] = Total number of pictures in this gallery
    [+maxigallery.previous_pic_url+] = Url to the previous picture link
    [+maxigallery.next_pic_url+] = Url to the next picture link
    [+maxigallery.index_url+] = Url to gallery overview index
    [+maxigallery.big_pic_exists+] = Indication that does the big picture exist. 1 for yes, 0 for no.
    [+maxigallery.picture_height_big+] = Heigth of the big picture
    [+maxigallery.picture_width_big+] = Width of the big picture
    [+maxigallery.picture_height_normal+] = Heigth of the normal picture
    [+maxigallery.picture_width_normal+] = Width of the normal picture
    [+maxigallery.picture_height_thumb+] = Heigth of the thumbnail picture
    [+maxigallery.picture_width_thumb+] = Width of the thumbnail picture

    pageNumberTpl
    Look for the default content in: assets/snippets/maxigallery/templates/pagenumbertpl.html

    [+maxigallery.pageurl+] = Url to that page
    [+maxigallery.pagenumber+] = Page number
    [+maxigallery.pagecount+] = Total number of pages
    [+maxigallery.currentpage+] = Current page number

    clearerTpl
    Look for the default content in: assets/snippets/maxigallery/templates/clearertpl.html

    No placeholders

    Also, look at the default css styles in: assets/snippets/maxigallery/css/default.css

    Important Notices

    The default templates uses PHx intensively. You don’t have to have PHx plugin installed though. The snippet is equipped with PHx parser class and it uses that automatically if the plugin is not found. But if you have PHx plugin installed, the snippet uses your plugin. NOTE! If you have PHx plugin installed, you need to update it to version 2.0 REV 3 atleast or any newer. (Rev 3 should be available in the resource repository within few minutes..)

    The use of PHx in the templates is not necessary, but for the snippet parameters to work automatically (eg. embedtype), default templates uses PHx and it’s conditionals to limit the amount of needed templates and offer great flexibility. But when you make your custom templates, you don’t have to use the conditionals if you don’t need them, just build the links for example the way you need them to be straight away.

    PHx is also used to do the htmlentities conversion. So in the templates, you will find :htmlent modifier in the picture title and description placeholders. If you need to have HTML code in those fields, just remove that modifier from the templates.

    There is still lots to do for the final v0.5 version, but this release will give you some idea where this snippet is going and gives me the possibility to hear some user input about the templates and available placeholders etc.. If you have any suggestions for extra placeholders of extra templates, please post your suggestions here.

    I have not made any other new features to this in compared to v0.4.1 other that what is said in the change log. I have all your previous suggestion and bug reports still listed (see the Trac tickets) and I will go into those next.

    Also note that I haven’t fully tested this code. For example, I havent yet tested the child galleries display mode at all, so don’t even know if it works, but please post all the bugs you may find here and I’ll look into those.

    Installation

    If you allready have MaxiGallery installed and you want to test this one, rename the current maxigallery folder under assets/snippets/ to something else. Then log in to MODxManager and copy the current maxigallery snippet code to a local text file on your computer what you can restore later.

    • 1. Copy the assets folder in to modx site root
    • 2. CHMOD assets/galleries/ folder to 0777 (unless you have phpsuexec or similar installed)
    • 3. Copy paste the contents of maxigallery.txt as new snippet
      [list][li]Use the same name as the old one, if you want to check that does the galleries still work with this one. Or create MaxiGallery2 or something if you want to test this as new snippet.
    [/li]
    [li]View your site[/li]
    [/list]

    So go and test it and report problems if you have some. Thanks for your attention! smiley

    Ps. I’m not at home until sunday, so there might be some lag in replys from my end.[/list]


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 26435
      • 1,193 Posts
      Holy $h|7!!! That is amazing doze! I am downloading this now.
      I would be happy to help start the wiki for this too (after I play with it for a bit laugh ) if you want. I am a HUGE fan of the wiki ever since I figured out the syntax. Let me know if you want me to get it started.

      -sD-
        Husband, Father, Brother, Son, Programmer, Atheist, Nurse, Friend, Lover, Fighter.
        All of the above... in no specific order.


        I send pointless little messages
        • 7923
        • 4,213 Posts
        Thanks for your comments laugh, I don’t know if it would be good to start doing the wiki just yet, because there probably will be some additions to the template placeholders or new templates or something.. depends how you guys like it. Altough, wiki can be modified at later stage too.. so it’s all the same. If you are willing to start it, I’d be glad!


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 32017
          • 151 Posts
          DEMO.... pleaeese smiley:) smiley
            London web design - MODx specialists
            • 16429
            • 254 Posts
            This is THE news of the week.
            Aside "some" security issue, of course wink
              kudo
              www.kudolink.com - webdesign (surprised?)

              [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
              • 7923
              • 4,213 Posts
              Quote from: waynep16 at Nov 08, 2006, 06:31 PM

              DEMO.... pleaeese smiley:) smiley
              It looks and functions just the same as 0.4.1, exept without the tables in html source.. But if someone installs this on a live server, please provide a demo link. I’ll setup a demo site later my self too, ofcourse.

              BTW. as a quick tip, If you want to use Jot with this MaxiGallery version, you would put the following in your pictureTpl:

              [!Jot? &docid=`[+maxigallery.pageinfo.id+]` &tagid=`[+maxigallery.picture.id+]`!]

              Didn’t test it, but it should work.


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 7923
                • 4,213 Posts
                Hello, anyone using this? Has there been any problems?

                The more I get user input at this point, the better! So please, report how it’s working and what improvement’s you’d like to see about templating..

                Also, I would like to hear, that have you been able to successfully upgrade from 0.4.1 galleries to this one, or has there been problems..


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Beginning experimentation. Two issues came up immediately.

                  This is with a bare snippet call, so they may be solved later by proper configuration, but these are not really unreasonable things to expect on a default call. (well, if quibbling over anything can be called "reasonable" with such an amazing snippet!)

                  When looking at enlarged images, there is a previous/index/next menu. This does not adjust for no more images when reaching the end of the list, clicking on "next" will go to the home page.

                  Cannot have links in the description. They are automatically converted to htmlentities somewhere in the processing.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 7923
                    • 4,213 Posts
                    Thanks for your comments Susan!

                    Quote from: sottwell at Nov 11, 2006, 07:30 PM

                    When looking at enlarged images, there is a previous/index/next menu. This does not adjust for no more images when reaching the end of the list, clicking on "next" will go to the home page.
                    Yes, it’s a bug, kind of. The "next" link should go back to the gallery main page if you are on a last picture, but there seems to be some bugs in that, I’ll fix it.

                    But, if you want the next and prev links to be just text if on a first/last picture (like they were in 0.4.1), then you can do that in the template with PHx. I’ll also make this change to the next beta.

                    In pictureTpl, Change:
                    <p>
                    	<a href="[+maxigallery.previous_pic_url+]">[+maxigallery.strings.previous+]</a> | 
                    	<a href="[+maxigallery.index_url+]">[+maxigallery.strings.index+]</a> | 		
                    	<a href="[+maxigallery.next_pic_url+]">[+maxigallery.strings.next+]</a>
                    </p>
                    


                    To:
                    <p>
                    [+maxigallery.counter:is=`1`:then=`
                    
                    	[+maxigallery.strings.previous+] |
                    
                    `:else=`
                    
                    	<a href="[+maxigallery.previous_pic_url+]">[+maxigallery.strings.previous+]</a> | 
                    
                    `+]
                    
                    	<a href="[+maxigallery.index_url+]">[+maxigallery.strings.index+]</a> | 		
                    
                    [+maxigallery.counter:is=`[+maxigallery.total_pics_count+]`:then=`
                    
                    	[+maxigallery.strings.next+]
                    
                    `:else=`
                    
                    	<a href="[+maxigallery.next_pic_url+]">[+maxigallery.strings.next+]</a>
                    
                    `+]
                    
                    </p>
                    


                    Quote from: sottwell at Nov 11, 2006, 07:30 PM

                    Cannot have links in the description. They are automatically converted to htmlentities somewhere in the processing.
                    In the templates, you see :htmlent PHx modifier in the placeholders, like [+maxigallery.picture.descr:htmlent+]. That modifier changes the content of that placeholder to htmlentities. So edit the template and remove the :htmlent modifier and you should be good to go.

                    Thank you very much for the comments! ..and people, keep em coming!



                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Thanks; my next step is to set up some templates of my own. I’m still not at all sure about this PHx business, but this is as good a time as any to learn it!
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org

                      This discussion is closed to further replies. Keep calm and carry on.