?
Solved

Change dreamweavers default double quotes to single quotes

Posted on 2006-06-27
5
Medium Priority
?
231 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 160 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 180 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

612 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