Solved

Change dreamweavers default double quotes to single quotes

Posted on 2006-06-27
5
203 Views
Last Modified: 2010-04-25
Hi,
By default dreamweaver outputs tags like this:

<img src="foo.gif" class="blah">

As you can see from the above the values are always enclosed in double quotes by default, how can i change the default to be single quotes?

eg:
<img src='foo.gif' class='blah'>

I am tired of everytime copying it into notepad and then running a replace all before inserting it into the db.

Or if I am barking up the wrong tree and this is not possible (changing DWs default behavior, just tell me and I'll give you the points anyway)

Thanks!
0
Comment
Question by:scarab890
  • 2
  • 2
5 Comments
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 40 total points
ID: 16998398
Hi scarab890,

I don't think there is an easy way to this.  You should look in this directory:

C:\Program Files\Macromedia\Dreamweaver 8\Configuration

for the file Configuration_ReadMe.htm which explains the layout of that directory.  There may be something easily editable.

However, I think this functionality is hard-coded and there isn't a good way to change it.  You can try working with the DW API to create an extension, but that would be the extent of it.
0
 
LVL 25

Expert Comment

by:Rouchie
ID: 16999091
Isn't it correct to use double-quotes in standard-compliant HTML?  I've always used this.  

Single quotes as far as I know are for javascript.
0
 

Author Comment

by:scarab890
ID: 16999800
Hi,
Thanks for replying.

I did check C:\Programs\Macromedia\Dreamweaver MX 2004\Configuration but didnt find my answer there

I have no idea of how to create an extentsion and since i am in the middle of a project, I really dont have time to take time off and learn :-(

Any other ideas?

@Rouchie, Not really bothered about being standard-compliant as long as it works and renders properly in IE and FF :-)

The reason I need single quotes is I am creating the content of the page in DW then just copying the whole table to the DB...but its screwing up my insert and fetch queries when there are double quotes.
I am trying to avoid using addslashes or str_replace, but does not look like i have a lot of choice.

Thanks!
0
 
LVL 25

Accepted Solution

by:
Rouchie earned 45 total points
ID: 17000914
Okay you're suffering a very common problem here.  The truth is that both single quotes & double quotes will mess up your database data because both those symbols are found in select statements.

Here's the recommended solution (IMO):
   - Use double quotes in your html.  Being standard-compliant is the only way it will render correctly in Firefox
   - Before you save the data to the database, double up your double-quotes(!).  Databases treat a single occurrence of a double-quote as a delimeter, but ignore doubled up entries.

So basically:
   <img src="foo.gif" class="blah">

would be saved as this:
   <img src=""foo.gif"" class=""blah"">

Try it and see what result you get - but backup your code first just in case :-)
0
 

Author Comment

by:scarab890
ID: 17001018
Its ok, thanks for your help guys, I am leaving DW alone and tackling this from the php side via mysql_real_escape_string()

I split the points as both of you tried to help me.

Thanks again!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question