mgGetTags caching?

Just finally got around to replacing a standard modx gallery with more gallery and must say its excellent :smile:

One thing Iā€™m stuck on - Iā€™ve used mgGetTags to pull the used tags from a gallery and Iā€™m using them with an existing sortable masonry / isotope layout - and all goodā€¦

However, I changed one of the tags slightly on an image and now the list includes the old one and new one in the sort menu - I canā€™t seem to make it forget the old oneā€¦

Iā€™ve emptied local caches, modx caches, and swapped browsers to no avail - am I missing something ?

Many thanks!

1 Like

Thereā€™s caching in core/cache/moregallery/, but that should get automatically cleared when you make a change anyway, so thatā€™s probably not it.

Perhaps youā€™re listing all tags and not just tags that have images assigned? If so, tags are stored separately and removing the last usage of a tag does not remove the tag record itself, meaning you might see both tags in the front- and back-end.

Hi Mark,

Ok thatā€™s maybe it - is there a distinction in the call ?

Currently Iā€™m bringing in the tag menu via [[!mgGetTags? &tpl=GalleryFilterMG-TAG]]

my tpl is just:

[[+display]]

Should I have something different to just pull assigned tags - of which there are currently just two ?

(I did delete the old one, yes).

Thanks!

That should get filtered on the current resource by default (https://docs.modmore.com/en/MoreGallery/v1.x/Snippets/mgGetTags.html#page_), but you could see if it works better when you add the resource param:

[[!mgGetTags? &tpl=`GalleryFilterMG-TAG` &resource=`[[*id]]`]]

Hi Mark,

Yep that did the trick straight way :slight_smile:

Thank you!

1 Like

Just stumbled upon this. For me itā€™s also necessary to provice

&resource=`[[*id]]`

Otherwise it would take also ā€œdeadā€ tags.

Speaking of ā€œtags are stored separatedlyā€:
is there a way to access/clean them (other than db/gitify)?