We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 48809
    • 4 Posts
    Здравствуйте! Прошу помочь разобраться с вложенными альбомами. Задача такая - есть несколько альбомов, например "Туфли", "Лапти", "Валенки" и "Сапоги". У каждого из них есть вложенные альбомы, допустим "Зима", "Весна", "Лето" и "Осень".
    Никак не могу соорудить правильный вывод, чтобы по клику на ссылку, допустим, "Лапти", выходила страничка с четырьмя разделами "Зима", "Весна", "Лето" и "Осень". И оттуда, соответственно, на галерейки. Это делается через теги, и, может, тогда и не нужны вложенные альбомы?

    Сейчас всё это выглядит примерно так:
    [[!GalleryAlbums? &toPlaceholder=`GalleryAlbums` &limit=`0` &albumCoverSort=`rank` &prominentOnly=`0` &rowTpl=`DemoGalAlbumRowTpl` &thumbWidth=`550` &thumbHeight=`322`]]
    [[!Gallery? &checkForRequestTagVar=`1` &toPlaceholder=`Gallery` &useCss=`0` &containerTpl=`DemoGalleryAlbumTpl` &thumbWidth=`240` &thumbHeight=`325` &thumbTpl=`DemoGalItemThumb` &imageWidth=`800` &imageHeight=`800` &parent=`[[+gallery.id]]` &showAll=`0` &showInactive=`1`]]
    [[!If? &subject=`[[+Gallery]]` &operator=`isempty` &then=`
    [[+GalleryAlbums]]
    ` &else=`
    [[+Gallery]]
    `]]


    И, соответственно, чанки:
    DemoGalAlbumRowTpl
    <div class="col-md-6">
    <div class="albumPreview" style="text-align:center;">
    <h3><a href="[[~[[*id]]? &[[+albumRequestVar]]=`[[+id]]`]]" style="
        color: #000;
        text-decoration: underline;
    ">[[+name]]</a></h3>
    <div class="thumb">
    <a href="[[~[[*id]]? &[[+albumRequestVar]]=`[[+id]]`]]"><img src="[[+image]]" alt="[[+name]]" style="width:100%;"/></a>
    </div>
    <div class="desc">
    <p>[[+description]]</p>
    </div>
    </div></div>


    DemoGalItemThumb
    <div class="[[+cls]]">
    <a href="[[+image]]" rel="colorbox" title="[[+description]]">
    <img class="[[+imgCls]]" src="[[+thumbnail]]" alt="[[+name]]" style="width:240px; height:325px;"/>
    </a>
    </div>


    DemoGalleryAlbumTpl
    <h1>[[+album_name]]</h1>
    <p>[[+album_description]]</p>
    [[+thumbnails]]


    Буду очень благодарен за помощь, потому что голова, если честно, уже кругом от этого)(