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

    I need some help to understand if I can do the following:

    I created an album in Gallery.
    I regret the fact there's only 2 fields associated with each image and, afaik, no way to easily add some more.
    Now I have the idea to associate a page to each image in gallery using the +description of Gallery.

    image --> docid in the revo documents tree, putting the doc id into the Gallery +description PL
    Page --> any TV
    Gallery call -> get the page TV ... meaning

    For each page associated to a Gallery image I'd like to get any field or TV of the page in order to have as many field as necessary to display data around each Gallery image.

    I'm trying to GetRessource from each page during the [[!Galery]] call.
    Of course ... nothing works.

    In my tpl chunk for each Gallery thumb I tried this:
    <li class="pix">
    PL +description de Gallery: [[+description]]
    
        <a class="big-image" href="[[+image]]" rel="colorbox" title="[[+description]]">
        	<img data-thumb="[[+thumbnail]]" data-href="[[+thumbnail]]" class="[[+imgCls]]" src="[[+thumbnail]]" alt="[[+name]]" />
        </a>
    <div class="description Xflex-caption caption elemHover">
    <span class="big">[[+name]]</span>
     - 
    <span class="orange">[[!getResourceField? &id=`[[+description]]` &field=`[[*description]]` &processTV=`1` &default=`Pas de description disponible`]]</span> 
     » <a href="[[+url]]" title="Voir ce site (nl onglet)">[[+url]]</a>
    <h4>Résumé</h4>
    <p>[[!getResourceField? &id=`[[+description]]` &field=`[[*introtext]]` &processTV=`1` &default=`Pas de résumé disponible`]]</p>
    
    </div>
    </li>


    Or / and I put the GetRessource calls into chunks to clarify a little bit like this:
    [[!getResourceField? &id=`[[+description]]` &field=`[[*introtext]]` &processTV=`1` &default=`Pas de résumé disponible`]]


    Get ressource does not grab what I'd like to target.

    Need some clarfication of any other ideas.

    Thanks a lot
      • 3749
      • 24,544 Posts
      I'm not clear on what you're trying to do, but for getResourceField, the &id property has to contain the ID of the resource you want the field from.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 36604
        • 268 Posts
        the idea is:
        to put into the
        PL +description of Gallery the id (single number) of an associated page

        during the 'loop' of the Gallery call, use this +description to access the concerned page (GetRessource)
        and
        get any needed tv into this page to display around the image.

        (the fact Gallery uses some PL with the same name of original pages field (description for instance) dould also be a pb. I don't know.
          • 36604
          • 268 Posts
          I'm now trying another way (with no more sucess)

          https://forums.modx.com/thread/70249/galleryitem-custom-tv-not-rendered
            • 3749
            • 24,544 Posts
            I'm afraid I haven't used Gallery enough to help you. Maybe someone else can.
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting