Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#73 2010-02-04 17:05:47

geroldbraun
Member
Registered: 2010-01-19
Posts: 19
Website

Re: smd_where_used: help keep your admin side tidy

a very valuable plugin, thank you. My usage today: I set up a subdomain (pagetest.mydomain.com) for testing before i will go life with my new txp-site. And soon i will have to look for links (in articles, in static-sites, in sidebars, etc.) that i will have to change from http://pagetest.mydomain.com to http://mydomain.com. None can’t be forgotten – just typed in “pagetest” .. now i can sleep quietly smooth :-))

Last edited by geroldbraun (2010-02-04 17:11:39)


Smile, Breath, Go slowly – Thich Nhat Hanh

Offline

#74 2010-02-04 17:58:15

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: smd_where_used: help keep your admin side tidy

geroldbraun wrote:

And soon i will have to look for links (in articles, in static-sites, in sidebars, etc.) that i will have to change from http://pagetest.mydomain.com to http://mydomain.com.

Here’s a very good reason for not hardcoding your internal URLs :) Use <txp:site_url /> and the only thing that needs to be changed is ‘Site URL’ in preferences.

Offline

#75 2010-02-05 11:26:15

geroldbraun
Member
Registered: 2010-01-19
Posts: 19
Website

Re: smd_where_used: help keep your admin side tidy

Ohh what a beautiful tip, Els, thank you


Smile, Breath, Go slowly – Thich Nhat Hanh

Offline

#76 2010-02-05 12:30:12

geroldbraun
Member
Registered: 2010-01-19
Posts: 19
Website

Re: smd_where_used: help keep your admin side tidy

arrgh – i think there is a little bug with <txp:site_url />. If i use it in forms everything is fine, but .. used in “article” to display a picture, the design of the site goes broken.
Example: a hardcoded <img src=“http://www.subpage.mydomain.de/images/6.jpg”> will do what expected; a tag-coded <img src=”<txp:site_url />images/6.jpg”> will not show the picture but “kill” the design.


Smile, Breath, Go slowly – Thich Nhat Hanh

Offline

#77 2010-02-05 12:47:15

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

Re: smd_where_used: help keep your admin side tidy

geroldbraun wrote:

If i use it in forms everything is fine, but .. used in “article” to display a picture, the design of the site goes broken.

It’s not a bug — it’s more than likely Textile getting in the way. If you want Textile in your articles, try:

==<img src="<txp:site_url />images/6.jpg">==

to switch textile off around that tag (or put the image on its own line with two spaces before it, which does the same thing) — I’m not sure if either technique works, I’ve never tried it when embedded inside an anchor.

Better still, if the image is managed by TXP’s Images tab, use:

<txp:image id="6" />

Last edited by Bloke (2010-02-05 12:48:14)


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

#78 2010-02-05 12:58:55

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

Re: smd_where_used: help keep your admin side tidy

@geroldbraun:

Also, for all internal links or references to files, images, etc, you don’t need to specify the domain. You can use an absolute path without including the full domain.

Like: <img src="/images/6.jpg" />
Or: <a href="/contact/">Contact me</a>

Those should remain working when you move your site.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#79 2010-02-05 21:38:59

geroldbraun
Member
Registered: 2010-01-19
Posts: 19
Website

Re: smd_where_used: help keep your admin side tidy

both of you maniqui and Bloke gave good advice, thank you. The textile turn-off == works fine and also omitting the url at all.


Smile, Breath, Go slowly – Thich Nhat Hanh

Offline

#80 2010-05-19 21:30:26

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

Re: smd_where_used: help keep your admin side tidy

Just a heads-up for those of you running SVN >= 3300. The pre-release version of smd_where_used (v0.3) can be grabbed from the beta download page. It adds the ability to search for text strings inside Stylesheets.


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

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

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

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: 859
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: 11,456
Website GitHub

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. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

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

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

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

Board footer

Powered by FluxBB