Title: Further template customization
Last modified: May 22, 2018

---

# Further template customization

 *  [ku6kus](https://wordpress.org/support/users/ku6kus/)
 * (@ku6kus)
 * [8 years ago](https://wordpress.org/support/topic/further-template-customization/)
 * Hi!
 * Could you tell me if it’s possible to further customize the output?
 * I’d like to make several attachment blocks each look like the block in the upper
   right corner (which is standard WP attachment).
 * Using filtering I managed to create a custom template.
 *     ```
       function dg_gallery_template($gallery, $use_descriptions) {
            if ( $use_descriptions ) {
   
                $gallery = '<div class="row">
       		<div class="medium-7 cell back-blue">
       			<div class="tabs-content custom" data-tabs-content="doc-tabs">%rows%</div></div>
   
       			<div class="toc medium-5 cell"><ul class="vertical tabs custom" data-tabs role="tablist" id="doc-tabs">%rows%</ul></div>
   
       			</div>';
            }
            return $gallery;
        }
        add_filter( 'dg_gallery_template', 'dg_gallery_template', 10, 2 );
   
        function dg_row_template($row, $use_descriptions) {
            if ( $use_descriptions ) {
                $row = '%icons%';
            }
            return $row;
        }
        add_filter( 'dg_row_template', 'dg_row_template', 10, 2 );
   
        function dg_icon_template($icon, $use_descriptions, $id) {
            if ( $use_descriptions ) {
                $icon = '<div class="tabs-panel is-active" id="panel_01"><img src="%img%" title="%title_attribute%" alt="%title_attribute%" %data%/>
   
                <a class="button btn-yellow" href="%link%" target="%target%">Скачать</a></div>';
            }
            return $icon;
        }
   
   
        add_filter( 'dg_icon_template', 'dg_icon_template', 10, 3 );
       ```
   
 * But I found out that I need to loop through the attachments (first for the pane
   content, than for the pane tab).
 * Is it possible? Also, if there any attachment_id variable? Couldn’t find any 
   in the class-document.php?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffurther-template-customization%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

The topic ‘Further template customization’ is closed to new replies.

 * ![](https://ps.w.org/document-gallery/assets/icon.svg?rev=983329)
 * [Document Gallery](https://wordpress.org/plugins/document-gallery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/document-gallery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/document-gallery/)
 * [Active Topics](https://wordpress.org/support/plugin/document-gallery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/document-gallery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/document-gallery/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [ku6kus](https://wordpress.org/support/users/ku6kus/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/further-template-customization/)
 * Status: not resolved