Aller au contenu principal

Selecting multiple images/folder at a time

Commentaires

6 commentaires

  • Zendesk API User
    Author: pavone - 8/27/2015 10:53

    Hello,

    every store element offers different getChildren methods. This should be what you're looking for.

    See StoreElement for more information.

    Best regards

    Tim

    0
  • Zendesk API User
    Author: thmarx - 9/22/2015 7:46

    Hello Srinivas,   

    do you need further help or did Tim's reply already help you? If so, it would be great if you marked

    his reply as "correct answer" so that other community users find the solution easily. If you have

    already found a solution by yourself, it would be very kind of you, if you posted it here.   

    Best regards 

    Thorsten

    0
  • Zendesk API User
    Author: Srinivasarao_Ko - 9/28/2015 9:09

    Hi,

    Thanks Tim for your remarkable comments. Since I get into other prioritized tasks I didn't get the time to work on this issue. So, I have not replyed to you, sorry for that. now I have started working on this again. I too feeling that your suggention will workout here. I am working towards that. I will keep updating you.

    Thanks again.

    Regards,

    Srinivas.

    0
  • Zendesk API User
    Author: Srinivasarao_Ko - 10/15/2015 9:09

    Hi,

    I have tried your approach Tim. since getChildren() is a method of store element, I have understood that I need to right one script file with some java stuff to achieve this. I thought it will be a lenghly process although we can do it in that way. I believe there should be a smarter way than writing a script file(with in HTML tab of Template). If you have something like that please post.

    Thanks in advance.

    Regards

    Srinivas.

    0
  • Zendesk API User
    Author: marza - 10/30/2015 14:16

    Hello Srinivas,

    if a script is more than a few lines it is possible to write a FirstSpirit module with an executable java class and reference it inside the script. For us that is the recommend way of doing this.

    You can find further information about this here and here (German PDF about FirstSpirit module Developement).

    Regards

    Marian

    0
  • Zendesk API User
    Author: Srinivasarao_Ko - 11/9/2015 14:34

    Hi,

    Finally I have implemented this without writing any script and without using getChildren() method. below is the procedure that I have implemented.

    1. firstly am checking the gallery item is folder or by using isFolder() method of StoreElement interface.

    2. if yes, am getting the childcount of folder in a variable by calling getChildCount() method of StoreElement interface.then am iterating a for loop from 0(zero) to childcount(size).

    3. in each loop, am checking the child type is Media or not. If it is Media then am checking it is picture or file.

    If it is picture am continuing with my code.

    Sample code:

    $CMS_IF(GalleryItem.get(#global.language,"stPicture").get().get().isFolder())$

               $CMS_SET(varChildCnt, GalleryItem.get(#global.language,"stPicture").get().get().getChildCount())$

               $CMS_IF(varChildCnt > 0)$

                   $CMS_FOR(childNum,[0 .. varChildCnt-1])$

                       $CMS_IF("Media".equals(GalleryItem.get(#global.language,"stPicture").get().get().getChild(childNum).getElementType())

                                 && GalleryItem.get(#global.language,"stPicture").get().get().getChild(childNum).getType == 1)$  $-- Type 1 means image, 0 means file--$

        Continueing with my logic..........

    Thanks,

    Srinivas.

    0

Vous devez vous connecter pour laisser un commentaire.