Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#49 2008-06-20 16:01:56

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: smd_where_used: help keep your admin side tidy

Replace the only incidence of
keywords
with
keywords,custom_1,custom_2,custom_3,custom_4,custom_5,custom_6,custom_7,custom_8,custom_9,custom_10,url_title
for custom field and url title search. (to be unelegantly ramped up further for glz_cf)

Would caption/alt support be possible, Stef?

Last edited by uli (2008-06-20 16:04:27)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#50 2008-06-20 16:17:01

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_where_used: help keep your admin side tidy

uli wrote:

Would caption/alt support be possible, Stef?

Not directly as you’ve done with the custom fields there. It doesn’t check the txp_image table… yet.

The only thing with allowing all these options all the time is that the more places you add to the search, the more specific you have to be when searching so you don’t find things you don’t want. Otherwise you trade the ease of searching with having to wade thru stuff you didn’t want to find! That’s why I didn’t add custom fields in the plugin because they’re so generic.

However, I would like to enhance the plugin eventually so that you can choose where it looks instead of it being fixed in the code. But that would require a truckload more checkboxes/some jQuery magic or a prefs/setup button which is a lot more code than I have time for right now. It’s on the TODO list, if I can figure out how to do it cleanly.

Last edited by Bloke (2008-06-20 16:18:09)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#51 2008-06-20 16:56:50

uli
Moderator
From: Cologne
Registered: 2006-08-15
Posts: 4,303

Re: smd_where_used: help keep your admin side tidy

The change is not too elegant, I know. But I needed it, and I tend to do on my own what I feel capable of. So posting the cf stuff wasn’t meant as a broad hint but rather as a “take and leave Stef alone” :)

Bloke wrote:

which is a lot more code than I have time for right now.

NP, with all that cf stuff I have what I mostly need.

Last edited by uli (2008-06-20 16:57:19)


In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links

Offline

#52 2008-12-20 01:14:05

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: smd_where_used: help keep your admin side tidy

Hi Bloke

What about adding the ability of also looking inside the styles?

And… is it possible to add the Where Used tab to more than one place on the admin side?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#53 2008-12-20 08:58:27

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_where_used: help keep your admin side tidy

maniqui wrote:

What about adding the ability of also looking inside the styles?

Not possible natively without some wider changes to the code, since the stylesheets are (stupidly imho) BASE-64 encoded, so the column in the database looks like an uninstalled plugin. If I was to enhance the initial part of the plugin (which I can do) to optionally specify some kind of ‘action’ to perform on a column before I work with it, then yes it’s possible. If I went this route I’d also like to allow you to specify which places to look in, which implies some kind of setup screen, and that’s a whole lot more coding.

Also, bear in mind that the plugin is designed to find where you have used a reference to something else. e.g. it finds where you have used Forms in Pages, and where you have used Pages or Stylesheets in Sections, and so on. It’s not a global ‘find text’ tool (at least, not yet…). Perhaps lam_search_replace could be extended for this purpose instead?

BTW, on the ToDo list is a simple jQuery addition to auto-focus the text box when you visit the tab. Annoys me every time.

And… is it possible to add the Where Used tab to more than one place on the admin side?

Yes. Again, it would require a prefs screen so you could specify under which tab(s) it appears. Why do you want this, btw? It’s an admin tool to help you tidy up your forms and pages as you develop a site, which should ideally be deleted when the site is live. I usually have it open on its own (Firefox) tab and then middle-click the results it gives back to open the pages/forms in their own tab and do the deletions. Do you use it differently?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#54 2008-12-20 11:55:58

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: smd_where_used: help keep your admin side tidy

Stef, adding a possibility to replace text would make this plugin perfect, in addition to searching style sheets. I have a template I want to export using hcg_templates, and in order to use export, I first have to change references in forms and pages like so: template_name_comments_form

Its a pain to do this manually, but worth it for the end user, who can simply import the template using hcg_templates and is then good to go.

Offline

#55 2008-12-20 13:02:15

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: smd_where_used: help keep your admin side tidy

By the way, I see errors with the plugin. I have a form called “footer” which is not recognised by where_used. Neither is a form called “header”. Tried the options “match case” and “whole words” but nothing found.

Offline

#56 2008-12-20 13:05:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_where_used: help keep your admin side tidy

jstubbs wrote:

By the way, I see errors with the plugin. I have a form called “footer” which is not recognised by where_used. Neither is a form called “header”

Daft question, but are they used ;-) (i.e. do you refer to them from other forms/pages?) Try the plugin without any search term and see if they show up as orphans.

Last edited by Bloke (2008-12-20 13:14:57)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#57 2008-12-20 13:20:58

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: smd_where_used: help keep your admin side tidy

Yes, they are used :-) Entering empty search terms results in “No results found.”

Offline

#58 2008-12-20 13:25:58

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: smd_where_used: help keep your admin side tidy

jstubbs wrote:

Yes, they are used :-)

Hmm, then the output doesn’t sound right at all. Since it’s working for me (famous last words), do you mind if I take look at your version in-situ? Might be an obscure PHP version thing, or something I’ve never encountered on my crummy old system.

Entering empty search terms results in “No results found.”

That also sounds fishy. Smacks of the plugin playing up, unless of course you are phenomenally tidy. In which case, well done on being one of the lucky few people to get a clean bill of health from the plugin :-)

Last edited by Bloke (2008-12-20 13:26:18)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#59 2008-12-20 13:33:38

keith
Member
From: Blyth, Northumberland, England
Registered: 2004-12-08
Posts: 199
Website

Re: smd_where_used: help keep your admin side tidy

Just to add – it finds all of my Header and Footer forms no problem…


Keith
Blyth, Northumberland, England
Capture The Moment

Offline

#60 2008-12-20 13:44:57

jstubbs
Moderator
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: smd_where_used: help keep your admin side tidy

Sending you a login now. This site is a new template, and I am preparing the form names for export. The new form is called “minima_photo_header” and where used does not find that either.

Offline

Board footer

Powered by FluxBB