Solved

Change dreamweavers default double quotes to single quotes

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

13 Experts available now in Live!

Get 1:1 Help Now