Re: smd_where_used: help keep your admin side tidy

I probably have considered it and then not done it. More than likely ‘cos I’m a slacker and shy away from hard work.

But the official reason is that the plugin’s not designed as smd_find_some_stuff_in_my_site, it’s smd_where_have_I_used_stuff_in_my_site. A subtle distinction to be sure, but an important one. The thing with images, files and (possibly) links is that it’s hard to figure out where you’ve used (i.e. referenced) them. And that stuffs up the orphans functionality.

I think I touched on this area in my reply to Jonathan. You could reference an image using <txp:image />, <txp:thumbnail />, <txp:article_image />, <txp:image_list /> or you could use it directly in your own HTML<img> tag, or even directly inside a stylesheet using background-image: url(/images/4.jpg). Plus in the TXP tags you can access images directly with id or name or category attributes so I’d need to check those too. Trying to look at all these potential places in all pages, forms, articles and stylesheets is going to increase the number of false negatives the plugin throws when you look for orphans.

A similar argument applies to files. I’m not sure about links because they’re more tightly controlled and you generally have to use a single tag to access them. Thus I could potentially filter for all <txp:linklist> tags. I’d have to assume that a linklist tag without a category means ‘all links are used’ and it would therefore return no orphans for a link search. Hmmm, I’ll have to chew that one over and see if it can be done.

Having said all that, the new stylesheet searching ability in v0.3 is a simple ‘find’ so maybe looking for images and files isn’t so hard. I’d just have to allow you to search for stuff that exists (i.e. when you type something) but omit files, images and links from the orphan results because it’s tricky to be absolutely sure something’s not referenced. I’ll give it some thought.

And I only stumbled upon the “find orphans” functionality late on in life (i.e. three weeks ago) – top stuff! So why not mention it in the Where Used tab & bask in the glory?

I suppose for people who hate documentation (or who simply find my docs impenetrable!), a single tagline somewhere in the plugin’s tab might help. I’ll add that to the 0.3 beta todo list, along with better regex support — there’s a subtle bug when searching for ‘%’ or ‘_’ characters in that it always treats them as wildcards. Tut tut.

Re: smd_where_used: help keep your admin side tidy

But the official reason is that the plugin’s not designed as smd_find_some_stuff_in_my_site, it’s smd_where_have_I_used_stuff_in_my_site. A subtle distinction to be sure, but an important one.

I must admit I use it as smd_find_some_stuff_in_my_site – so being able to find “content” within link alternate text would be just as useful as the current ability to find content within article titles & bodies.

With regards to finding links or files where they’ve been referenced – it’s impossible to do that with articles so I wouldn’t expect it to find links or images either.