Solved

Change dreamweavers default double quotes to single quotes

Posted on 2006-06-27
5
198 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Manipulate Access Database from Web Page 8 510
Search/Results Pages 7 393
Best way to make existing site mobile 5 130
Adobe Acrobat Pro top display text upside down? 5 105
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…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now