Textpattern Forum

You are not logged in. Register | Login | Help

#81 2010-08-24 00:45:49

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 899
Website

Re: smd_where_used: help keep your admin side tidy

Hi Stef,

This is one of my always-install-with-every-website plugins. It’s invaluable, thanks.

Ever considered extending it to search through images (filename, alt, caption) & links (title, url, description)?

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?

Cheers,

Adi

Offline

#82 2010-08-24 06:32:14

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 813
Website

Re: smd_where_used: help keep your admin side tidy

I’ve just installed this (first time I’ve seen it) – unreal, thanks Stef

What a time saver

Offline

#83 2010-08-24 08:40:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,848
Website

Re: smd_where_used: help keep your admin side tidy

gomedia wrote:

Ever considered extending it to search through images (filename, alt, caption) & links (title, url, description)?

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.

tye wrote:

thanks Stef… What a time saver

You’re welcome. Glad it’s useful.

Last edited by Bloke (2010-08-24 08:42:18)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#84 2010-08-24 09:48:52

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 899
Website

Re: smd_where_used: help keep your admin side tidy

Bloke wrote:

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.

Offline

#85 2010-11-05 09:00:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,848
Website

Re: smd_where_used: help keep your admin side tidy

smd_where_used v0.30 is out. For TXP 4.3.0 or higher only.

The only new feature is the ability to search inside Stylesheets. The other stuff I mentioned above will be along in a future version as I haven’t had a chance to look at it yet.

Last edited by Bloke (2010-11-05 09:02:13)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#86 2010-11-05 15:02:29

mrdale
Moderator
From: Walla Walla
Registered: 2004-11-19
Posts: 2,059
Website

Re: smd_where_used: help keep your admin side tidy

Thanks mate. This one is in my standard suite, so searching stylesheets is just swimming.

Idea: If you wanted to turn this into the be all and end all (and spent countless hours donating even more of your time to the community), you add a replace function. ;)

[mrdale slowly backs away]

Offline

#87 2011-03-23 17:29:43

johnstephens
Plugin Author
From: Harrisonburg, VA
Registered: 2008-06-01
Posts: 821
Website

Re: smd_where_used: help keep your admin side tidy

This might be a complicated RegEx question. Can I use where_used to find all txp:article tags that are used as a container?

Offline

#88 2011-03-23 20:58:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,848
Website

Re: smd_where_used: help keep your admin side tidy

johnstephens wrote:

Can I use where_used to find all txp:article tags that are used as a container?

Sadly it doesn’t do regexes yet. Nor wildcards. Both are planned at some unspecified juncture.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#89 2011-03-23 21:14:15

johnstephens
Plugin Author
From: Harrisonburg, VA
Registered: 2008-06-01
Posts: 821
Website

Re: smd_where_used: help keep your admin side tidy

Cool, thanks!

Offline

#90 2011-03-23 21:46:43

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,384
Website

Re: smd_where_used: help keep your admin side tidy

johnstephens wrote:

Can I use where_used to find all txp:article tags that are used as a container?

Couldn’t you just search for </txp:article>?


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

Board footer

Powered by FluxBB