We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 6726
    • 7,075 Posts
    Yet another question !
    Sorry for the resource usage the last few days, I am beginning to feel like a Help Vampire lipsrsealed

    I know it’s a planned feature


    * Possible to have custom fields in picture management

    but let’s say I need a couple additionnal fields for pictures with 0.5.2

    How would I go about it ?
    It seems to me I can’t use TVs, since they are assigned to templates and pictures are not stored as documents thus can’t have a template and therefore TVs.

    I am thinking I need additionnal fields in the maxigallery table. Am I wrong ?

    Then, I’d need to modify the sql logic in maxigallery.php (I have trouble finding where it is)


    and set placeholders to use in my template (around line 719) :

    $pictureTplData['pageinfo'] = $mg->pageinfo;
    	$pictureTplData['big_img_linkstyle'] = $mg->mgconfig['big_img_linkstyle'];
    	$pictureTplData['keep_bigimg'] = intval($mg->mgconfig['keep_bigimg']);
    	$pictureTplData['strings'] = $mg->strings;
    	$pictureTplData['config'] = $mg->mgconfig;
    	$pictureTplData['path_to_gal'] = $mg->path_to_gal;
    	$pictureTplData['total_pics_count'] = $total_pics;


    and there (around line 750)

    $pics[$i]['title'] = stripslashes($pics[$i]['title']);
    		$pics[$i]['descr'] = stripslashes($pics[$i]['descr']);
    		$pictureTplData['picture'] = $pics[$i];
    		$pictureTplData['counter'] = $pic_number;


    Then I use [+maxigallery.picture.fieldname+] placeholder in the template with the new fields name ?

    Is that it ?

      .: COO - Commerce Guys - Community Driven Innovation :.


      MODx est l'outil id
      • 7923
      • 4,213 Posts
      No.. you don’t have to edit the maxigallery.picture.* array, but you need to add your new fields to the manage template data etc.

      See this thread: Any way to add description to picture?

      I can guide you through the process if you want.. from that post you see short guidelines of the things you need to do.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 6726
        • 7,075 Posts
        Thanks Doze, that’s very cool but I think I’ll manage, it seems way more straightforward than I would have thought : kudos !

        If I have trouble I might ask you yet another question embarrassed
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id