Tags filtering and gallery items count

Permalink Browser Info Environment
Hi shahroq,
I finally got my new website working using your great addon, if you remember i asked you some time ago about calling express data into custom template.
If you want to have a look here is the gallery url :http://mattpesquet.com/work/

My first question is about Tag filtering (i also use a custom file attribute to handle my own tags, and being able to set multiple tags to multiples files selection into file manager):
Is it possible to have tag filtering buttons filtering from all tags of each gallery item instead of the first tag of the list ?
I already tried to find a solution few month ago in controller.php and came across interesting lines of code, but i cant remember exactly which ones.
I guess it might be after :
@line 268  private function getGalleryInfoFileSet()
@line 272        //filter tags (buttons)
        $this->gallery->optionsObj->fTagsAr = explode(',',$this->gallery->optionsObj->fTags); //print_r($this->gallery->optionsObj->fTagsAr);die;


there is also that part :
@line 310            //get tags:
            $tags_attribute = Config::get('whale_grid_gallery.tags_attribute');
            if ($tags_attribute) {
                $fileTags = array();
                $gallery_tags = trim($fv->getAttribute($tags_attribute));
                if($gallery_tags) $tmp = explode("\n", str_replace(array("\r", ","), "\n", $gallery_tags));
            } else {
                $fileTags = $fv->getTagsList();
            }


@line 334:
//remove tags that are not in user selection:
            $tmp->tags = array_intersect($fileTags, $this->gallery->optionsObj->fTagsAr);
            $firsttag = array_shift($tmp->tags); //$firsttag is string, $tags is array of second to last tags
            $tmp->dataTags = "";
            if ($firsttag) $tmp->dataTags .= ' data-category="'.$firsttag.'"';
            if (count($tmp->tags)>0) $tmp->dataTags .= ' data-others="-'.implode("-", $tmp->tags).'-"';

Even if i know this part is to remove unwanted Tags (selected by user in edit window of the block), but it is where i see the $firsttag variable, that seems directly involved in the filtering working only on first Tag, and not the whole list of each item.

There is also further in controller.php a commented part of code :
@line 376            /*
            //tags
            if ($this->gallery->optionsObj->gFiltersEnable==1) {
                $tmp->tags = $fv->getTagsList();
                $tmp->tags_data = '';
                if (count($tmp->tags)>0){
                    //$tmp->tags_data = implode("", $tmp->tags);
                    foreach ($tmp->tags as $value) $tmp->tags_data .= $this->tagKeyGenerator($value)." ";
                }
            }
            */


The second question might be shorter, is it possible to display number of gallery items (just as it appears in block edit window : 'fileset-count') somewhere in my custom template ? what is the line of code to insert into some html tag please ?
Maybe if it can be seen in lightbox view ?

Best regards.

Type: Discussion
Status: In Progress
MattPesquet
View Replies:
shahroq replied on at Permalink Reply
shahroq
Hi Matt,
Sorry, I missed your ticket among other support requests.
1- Actually I didn't get what do you mean by "filtering from all tags of each gallery item instead of the first tag of the list". Can you elaborate on that part?
2- You can echo the number of files by:
echo count($gallery);

concrete5 Environment Information

# concrete5 Version
Core Version - 8.3.2
Version Installed - 8.3.2
Database Version - 20180122213656

# concrete5 Packages
Community Store (1.3.2), Cycle2 Slide Show (1.0.2), Enhanced Version List (0.9.2), Font Awesome Font Icons for CKEditor (0.9.1), Honest Websites Back To Top (1.0.1), Login/Logout Link (1.0), Simple Gallery (1.0.7), Stripe Payment Method (1.0.5), Vivid Simple Accordion (1.0.1), Whale Grid Gallery (2.4.5)

# concrete5 Overrides
blocks/image_slider/templates/animate/view.css, blocks/image_slider/templates/animate/view.php, blocks/image_slider/templates/animate, blocks/image_slider/templates/mp/view.css, blocks/image_slider/templates/mp/view.php, blocks/image_slider/templates/mp, blocks/image_slider/templates, blocks/image_slider, blocks/search/templates/mp.php, blocks/search/templates, blocks/search, blocks/next_previous/view.php, blocks/next_previous, blocks/vivid_simple_slider/templates/mp/form.php, blocks/vivid_simple_slider/templates/mp/img/arrow-right.png, blocks/vivid_simple_slider/templates/mp/img/arrow-left.png, blocks/vivid_simple_slider/templates/mp/img, blocks/vivid_simple_slider/templates/mp/js/swiper.js, blocks/vivid_simple_slider/templates/mp/js, blocks/vivid_simple_slider/templates/mp/elements/page_selector.php, blocks/vivid_simple_slider/templates/mp/elements, blocks/vivid_simple_slider/templates/mp/css/swiper.css, blocks/vivid_simple_slider/templates/mp/css, blocks/vivid_simple_slider/templates/mp/view.php, blocks/vivid_simple_slider/templates/mp/icon.png, blocks/vivid_simple_slider/templates/mp, blocks/vivid_simple_slider/templates, blocks/vivid_simple_slider, blocks/login_logout_link/templates/mp.php, blocks/login_logout_link/templates, blocks/login_logout_link, blocks/simple_gallery/templates/mp/js/isotope.pkgd.min.js, blocks/simple_gallery/templates/mp/js, blocks/simple_gallery/templates/mp/view.php, blocks/simple_gallery/templates/mp, blocks/simple_gallery/templates, blocks/simple_gallery, blocks/feature/templates/mp/view.php, blocks/feature/templates/mp, blocks/feature/templates, blocks/feature, blocks/jero_cycle/img/arrow-right.png, blocks/jero_cycle/img/arrow-left.png, blocks/jero_cycle/img, blocks/jero_cycle/templates/mp/view.css, blocks/jero_cycle/templates/mp/view.php, blocks/jero_cycle/templates/mp, blocks/jero_cycle/templates, blocks/jero_cycle, blocks/whale_grid_gallery/templates/mp.php, blocks/whale_grid_gallery/templates, blocks/whale_grid_gallery, blocks/community_product/view.php, blocks/community_product, elements/account/menu.php, elements/account, css/img/icons.png, css/img/loader.gif, css/img, css/back-to-top.css, css/gridgallery/gridGallery.css, css/gridgallery/gridGallery_bk.css, css/gridgallery, themes/mp/description.txt, themes/mp/page_forbidden.php, themes/mp/page_not_found.php, themes/mp/index.html, themes/mp/js/wow.js, themes/mp/js, themes/mp/thumbnail.png, themes/mp/elements/header_top.php, themes/mp/elements/footer.php, themes/mp/elements/footer_bottom.php, themes/mp/elements/header.php, themes/mp/elements, themes/mp/full.php, themes/mp/images/background-slider-default.png, themes/mp/images/background-slider-royal.png, themes/mp/images/background-slider-blue-sky.png, themes/mp/images/background-slider-night-road.png, themes/mp/images/background.png, themes/mp/images, themes/mp/gallery.php, themes/mp/css/styles.xml, themes/mp/css/bootstrap-modified.css, themes/mp/css/animate.css, themes/mp/css/presets/night-road.less, themes/mp/css/presets/defaults.less, themes/mp/css/presets/blue-sky.less, themes/mp/css/presets/royal.less, themes/mp/css/presets/mp-defaults.less, themes/mp/css/presets, themes/mp/css/build/mobile/navigation.less, themes/mp/css/build/mobile, themes/mp/css/build/breadcrumb.less, themes/mp/css/build/fonts/night-road.less, themes/mp/css/build/fonts/defaults.less, themes/mp/css/build/fonts/blue-sky.less, themes/mp/css/build/fonts/royal.less, themes/mp/css/build/fonts/mp-defaults.less, themes/mp/css/build/fonts, themes/mp/css/build/blocks/feature.less, themes/mp/css/build/blocks/faq.less, themes/mp/css/build/blocks/next-previous.less, themes/mp/css/build/blocks/topic-list.less, themes/mp/css/build/blocks/testimonial.less, themes/mp/css/build/blocks/page-title-option-byline.less, themes/mp/css/build/blocks/page-list-option-buttons.less, themes/mp/css/build/blocks/page-list-template-thumbnail-grid.less, themes/mp/css/build/blocks/image.less, themes/mp/css/build/blocks/date-navigation.less, themes/mp/css/build/blocks/page-attribute-display.less, themes/mp/css/build/blocks/tags.less, themes/mp/css/build/blocks/feature-template-hover-description.less, themes/mp/css/build/blocks/page-title.less, themes/mp/css/build/blocks/image-slider.less, themes/mp/css/build/blocks/page-list.less, themes/mp/css/build/blocks, themes/mp/css/build/bootstrap-3.2.0/utilities.less, themes/mp/css/build/bootstrap-3.2.0/button-groups.less, themes/mp/css/build/bootstrap-3.2.0/bootstrap.less, themes/mp/css/build/bootstrap-3.2.0/modals.less, themes/mp/css/build/bootstrap-3.2.0/popovers.less, themes/mp/css/build/bootstrap-3.2.0/jumbotron.less, themes/mp/css/build/bootstrap-3.2.0/responsive-embed.less, themes/mp/css/build/bootstrap-3.2.0/forms.less, themes/mp/css/build/bootstrap-3.2.0/normalize.less, themes/mp/css/build/bootstrap-3.2.0/mixins/opacity.less, themes/mp/css/build/bootstrap-3.2.0/mixins/nav-vertical-align.less, themes/mp/css/build/bootstrap-3.2.0/mixins/size.less, themes/mp/css/build/bootstrap-3.2.0/mixins/grid-framework.less, themes/mp/css/build/bootstrap-3.2.0/mixins/forms.less, themes/mp/css/build/bootstrap-3.2.0/mixins/resize.less, themes/mp/css/build/bootstrap-3.2.0/mixins/progress-bar.less, themes/mp/css/build/bootstrap-3.2.0/mixins/nav-divider.less, themes/mp/css/build/bootstrap-3.2.0/mixins/table-row.less, themes/mp/css/build/bootstrap-3.2.0/mixins/gradients.less, themes/mp/css/build/bootstrap-3.2.0/mixins/image.less, themes/mp/css/build/bootstrap-3.2.0/mixins/text-emphasis.less, themes/mp/css/build/bootstrap-3.2.0/mixins/vendor-prefixes.less, themes/mp/css/build/bootstrap-3.2.0/mixins/responsive-visibility.less, themes/mp/css/build/bootstrap-3.2.0/mixins/pagination.less, themes/mp/css/build/bootstrap-3.2.0/mixins/buttons.less, themes/mp/css/build/bootstrap-3.2.0/mixins/tab-focus.less, themes/mp/css/build/bootstrap-3.2.0/mixins/center-block.less, themes/mp/css/build/bootstrap-3.2.0/mixins/hide-text.less, themes/mp/css/build/bootstrap-3.2.0/mixins/clearfix.less, themes/mp/css/build/bootstrap-3.2.0/mixins/panels.less, themes/mp/css/build/bootstrap-3.2.0/mixins/reset-filter.less, themes/mp/css/build/bootstrap-3.2.0/mixins/border-radius.less, themes/mp/css/build/bootstrap-3.2.0/mixins/grid.less, themes/mp/css/build/bootstrap-3.2.0/mixins/text-overflow.less, themes/mp/css/build/bootstrap-3.2.0/mixins/list-group.less, themes/mp/css/build/bootstrap-3.2.0/mixins/alerts.less, themes/mp/css/build/bootstrap-3.2.0/mixins/background-variant.less, themes/mp/css/build/bootstrap-3.2.0/mixins/labels.less, themes/mp/css/build/bootstrap-3.2.0/mixins, themes/mp/css/build/bootstrap-3.2.0/navbar.less, themes/mp/css/build/bootstrap-3.2.0/code.less, themes/mp/css/build/bootstrap-3.2.0/media.less, themes/mp/css/build/bootstrap-3.2.0/dropdowns.less, themes/mp/css/build/bootstrap-3.2.0/responsive-utilities.less, themes/mp/css/build/bootstrap-3.2.0/close.less, themes/mp/css/build/bootstrap-3.2.0/progress-bars.less, themes/mp/css/build/bootstrap-3.2.0/tables.less, themes/mp/css/build/bootstrap-3.2.0/breadcrumbs.less, themes/mp/css/build/bootstrap-3.2.0/component-animations.less, themes/mp/css/build/bootstrap-3.2.0/pagination.less, themes/mp/css/build/bootstrap-3.2.0/buttons.less, themes/mp/css/build/bootstrap-3.2.0/variables.less, themes/mp/css/build/bootstrap-3.2.0/temp_bootstrap-xl.less, themes/mp/css/build/bootstrap-3.2.0/input-groups.less, themes/mp/css/build/bootstrap-3.2.0/thumbnails.less, themes/mp/css/build/bootstrap-3.2.0/scaffolding.less, themes/mp/css/build/bootstrap-3.2.0/pager.less, themes/mp/css/build/bootstrap-3.2.0/navs.less, themes/mp/css/build/bootstrap-3.2.0/badges.less, themes/mp/css/build/bootstrap-3.2.0/tooltip.less, themes/mp/css/build/bootstrap-3.2.0/theme.less, themes/mp/css/build/bootstrap-3.2.0/panels.less, themes/mp/css/build/bootstrap-3.2.0/bootstrap-xl.less, themes/mp/css/build/bootstrap-3.2.0/type.less, themes/mp/css/build/bootstrap-3.2.0/glyphicons.less, themes/mp/css/build/bootstrap-3.2.0/print.less, themes/mp/css/build/bootstrap-3.2.0/wells.less, themes/mp/css/build/bootstrap-3.2.0/grid.less, themes/mp/css/build/bootstrap-3.2.0/list-group.less, themes/mp/css/build/bootstrap-3.2.0/mixins.less, themes/mp/css/build/bootstrap-3.2.0/carousel.less, themes/mp/css/build/bootstrap-3.2.0/alerts.less, themes/mp/css/build/bootstrap-3.2.0/labels.less, themes/mp/css/build/bootstrap-3.2.0, themes/mp/css/build/content.less, themes/mp/css/build/search.less, themes/mp/css/build/miscellaneous-styles.less, themes/mp/css/build/add-ons/calendar.less, themes/mp/css/build/add-ons, themes/mp/css/build/custom-design-classes/area-content-accent.less, themes/mp/css/build/custom-design-classes/block-sidebar-padded.less, themes/mp/css/build/custom-design-classes/recent-blog-entry.less, themes/mp/css/build/custom-design-classes/block-sidebar-wrapped.less, themes/mp/css/build/custom-design-classes/testimonial-bio.less, themes/mp/css/build/custom-design-classes/blog-entry-list.less, themes/mp/css/build/custom-design-classes, themes/mp/css/build/captcha.less, themes/mp/css/build/pagination.less, themes/mp/css/build/buttons.less, themes/mp/css/build/header.less, themes/mp/css/build/footer.less, themes/mp/css/build/body.less, themes/mp/css/build/errors.less, themes/mp/css/build/mixins.less, themes/mp/css/build/reset.less, themes/mp/css/build, themes/mp/css/main.less, themes/mp/css/bootstrap-modified-clean.css, themes/mp/css, themes/mp/home.php, themes/mp/right_sidebar.php, themes/mp/left_sidebar.php, themes/mp/blank.php, themes/mp/view.php, themes/mp/page_theme.php, themes/mp/default.php, themes/mp

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
litespeed

# PHP Version
7.0.33

# PHP Extensions
bcmath, bitset, bz2, calendar, Core, ctype, curl, date, dom, eio, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, ionCube Loader, json, libxml, litespeed, mbstring, mcrypt, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, pspell, readline, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, yaml, zip, zlib

# PHP Settings
max_execution_time - 240
log_errors_max_len - 1024
max_file_uploads - 50
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 512M
post_max_size - 256M
sql.safe_mode - Off
upload_max_filesize - 64M
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.