Refactoring support for CSS, PHP!

Let us know what you would like to see in the next version of this software

Moderator: kfury77

Forum rules
Please follow these guidelines when posting feature requests. This will help to increase the value of your contribution.
  • Do not create new topics for already requested features. Add your comments to the existing feature request topics instead;
  • Create separate topic for each feature suggestion. Do NOT post a number of non-related feature suggestions in a single topic;
  • Give your topic a meaningful title. Do NOT create topics with meaningless titles, such as "My Suggestion" or "My Problem".
Please note that we DO READ all suggestions, even if a reply is not posted. Thanks!
Post Reply
Charybdis
Posts: 10
Joined: Thu Aug 02, 2007 2:12 pm

Refactoring support for CSS, PHP!

Post by Charybdis »

I think refactoring support would be great.

This is only an extension to the find & replace function, so it could be easily implemented.

For example, I have the "middle" CSS class, in 100 CSS and HTML files, and I want to rename it.

I could use the find & replace, but what if I have the word "middle" in my text? I want to replace only the CSS class "middle". How do you do this with find & replace?

Another example of refactoring: I have a CSS file, and I want to rename it. But 100 HTML files link to this CSS! So, I rename the CSS file, the program recognize that this CSS is used in 100 HTML files, and update the links in the 100 HTML files after confirm. What a great feature! (Dreamweaver can do this.)

The same thing is with HTML files. (After rename a HTML file, update the links.)

I hope this helps.
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Post by syrupcore »

these are interesting suggestions. a couple of things, in case the team doesn't have the time (or user requests) to implement them:

where ever possible, use meaningful class/ID names in your HTML/CSS. If they are semantic, you'll run into the need to change them much less often. Things like .green or .middle are names that describe the way something looks instead of what it means. When you need to change the display, the class names no longer make sense. .adheading and .subcontent are names that transfer meaning and aren't tied to the way they look today.

if you can, use header/footer inlcudes! if you need to rename a css or js file, you'll only need to update the single header.php. :)

will
Charybdis
Posts: 10
Joined: Thu Aug 02, 2007 2:12 pm

Post by Charybdis »

syrupcore wrote:these are interesting suggestions. a couple of things, in case the team doesn't have the time (or user requests) to implement them:

where ever possible, use meaningful class/ID names in your HTML/CSS. If they are semantic, you'll run into the need to change them much less often. Things like .green or .middle are names that describe the way something looks instead of what it means. When you need to change the display, the class names no longer make sense. .adheading and .subcontent are names that transfer meaning and aren't tied to the way they look today.

if you can, use header/footer inlcudes! if you need to rename a css or js file, you'll only need to update the single header.php. :)

will
Yes, but what if I want to rename a HTML file or move it in another directory?

Lets say, I have links to this HTML file in 100 files in my project. In this case, I can not use the search and replace, nor the header.php.

Because I can link to this HTML file like this:
../../myfolder/some.html
myfolder/some.html
some.html

If I move the some.html out from myfolder, then all the relative links must be updated.
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Post by syrupcore »

moving files and link renaming can be taken care of on the server level as well. http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html every time you move/rename a file, you update this text file and the server will re route all incoming requests.

Thing is, you really sorta need to do this part anyway on public facing sites otherwise external links will 404 as well. Other servers have similar techniques.
User avatar
syrupcore
Top Contributor
Posts: 917
Joined: Thu Jul 21, 2005 12:58 am
Location: Portland, Oregon, usa
Contact:

Post by syrupcore »

I'm not trying to squelch your feature request. Just some suggestions for dealing with the problems with the tools available right now.

sorry if it reads differently.

Will
Post Reply