Highlighted

Dreamweaver 2014 for Mac: Insert <br /> in HTML5 in code and design view

Participant ,
Dec 06, 2018

Copy link to clipboard

Copied

Hi.

I switched from XHTML to HTML5.

In the design view the tag <br> is inserted, in the code view <br />.

I like to get a <br /> in the design view too.

I use macOS Mojave.

I found https://alistapart.com/article/dreamweaver  with the hint, to edit a configuration file.

/Applications/Adobe Dreamweaver CC 2014/Configuration/Objects/Characters/Line Break.htm

But editing that file as described in the article had no effect.

How can solve the problem please?

Further:


I like to modify the new empty file, which appears, when you press CMD+N.

Which config file do I have to edit please?

I like to get a file "unnamed-1.php" with some code in the head, I prefer.

Further:

Which config file do I have to edit, when I want to change the behaviour of CMD+SHIFT+SPACE?

Standard is:  & n b s p ; (spaces only for this forum posting)
I wish to get the unicode character " "

Thanks for your help

TOPICS
Dreamweaver CC 2014, Dreamweaver | Mac OS issues

Views

726

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Dreamweaver 2014 for Mac: Insert <br /> in HTML5 in code and design view

Participant ,
Dec 06, 2018

Copy link to clipboard

Copied

Hi.

I switched from XHTML to HTML5.

In the design view the tag <br> is inserted, in the code view <br />.

I like to get a <br /> in the design view too.

I use macOS Mojave.

I found https://alistapart.com/article/dreamweaver  with the hint, to edit a configuration file.

/Applications/Adobe Dreamweaver CC 2014/Configuration/Objects/Characters/Line Break.htm

But editing that file as described in the article had no effect.

How can solve the problem please?

Further:


I like to modify the new empty file, which appears, when you press CMD+N.

Which config file do I have to edit please?

I like to get a file "unnamed-1.php" with some code in the head, I prefer.

Further:

Which config file do I have to edit, when I want to change the behaviour of CMD+SHIFT+SPACE?

Standard is:  & n b s p ; (spaces only for this forum posting)
I wish to get the unicode character " "

Thanks for your help

TOPICS
Dreamweaver CC 2014, Dreamweaver | Mac OS issues

Views

727

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Dec 06, 2018 0
Adobe Community Professional ,
Dec 06, 2018

Copy link to clipboard

Copied

For your first issue, the <br> vs <br/> problem? I guess I never noticed it, I use so few <br> tags in general. I don't have any idea if/where that can be changed. Hopefully someone else has an idea.

To change the code of your default new, you can add to the file at...

C: > Program Files > Adobe > Dreamweaver (your version) > configuration > DocumentTypes > NewDocuments > Default.html

I believe the Mac version starts at Macintosh HD > Application support, but someone with a Mac would need to confirm that for you.

To modify the file:

1. Open it in DW and make your changes. Don't worry about the doctype declaration or the charset meta tag, those get changed automatically by DW depending on your settings. Anything else you add will appear in a new document.

2. Save to your desktop


3. Drag from your desktop to the folder path above. You will need Admin rights to drop it in place, overwriting the original

Your final question, for the keyboard shortcut of a non-breaking space, go to...

Edit > Keyboard Shortcuts > Menu Commands > HTML > Non-Breaking-Space.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 1
Participant ,
Dec 06, 2018

Copy link to clipboard

Copied

Thanks for the hint to change default.html

I tried that, without success.

Mac SSD > Applications > Adobe > Dreamweaver 2014 > configuration > DocumentTypes > NewDocuments > Default.html

I just changed

<head>

to

<link href="/css/default.css" rel="stylesheet" type="text/css" />
<head>

I closed DW and reopened it.
CMD+N
The link element does not appear.

I go back to my file manager to check, if the change is really there. in default.html. It is.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 0
Adobe Community Professional ,
Dec 06, 2018

Copy link to clipboard

Copied

That's the right spot, I've done that modification myself for every version of DW from CS4 to CC2019.

I know this is a little "is it plugged in" as far as troubleshooting goes, but...

Are you sure you made the change to the Default.html file and not one of the others?
Are you sure you're using the same version of the program as the file you modified (multiple DW versions would all need to be changed)?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 0
Participant ,
Dec 06, 2018

Copy link to clipboard

Copied

Yes, I'm sure. It is /Applications/Adobe Dreamweaver CC 2014/Configuration/DocumentTypes/NewDocuments/Default.html

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 0
LEGEND ,
Dec 06, 2018

Copy link to clipboard

Copied

mistershortcut  wrote

Hi.

I switched from XHTML to HTML5.

In the design view the tag <br> is inserted, in the code view <br />.

I like to get a <br /> in the design view too.

Its more like you need to get <br> in the code view as html 5 doesnt require the closing tag.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 0
Participant ,
Dec 06, 2018

Copy link to clipboard

Copied

I know that is not required, but I have my reasons. Example: sometimes the markup will be used by a DOM parser of a script. It's safer when every empty element uses the same syntax <element />.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 0
Adobe Community Professional ,
Dec 06, 2018

Copy link to clipboard

Copied

Ah, oops, to change non breaking space to something else, I'm not sure where you would look for that. Sorry, I misread that question. Personally, I'd just use the snippet panel and set a keyboard shortcut for it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 1
LEGEND ,
Dec 06, 2018

Copy link to clipboard

Copied

mistershortcut  wrote

I know that is not required, but I have my reasons. Example: sometimes the markup will be used by a DOM parser of a script. It's safer when every empty element uses the same syntax <element />.

Well in that case I would stick to a doctype that uses the <br /> or do a find and replace <br /> with <br> if you are working on an old document and want to use html 5. I dont see the point in using html5 if you are going to use old syntax with it personally.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 1
Adobe Community Professional ,
Dec 06, 2018

Copy link to clipboard

Copied

Oh, another item to check, are you creating a new .html document with DW when you hit CMD+N, or is it set to another file type?

You'll need to modify other files if your default action creates something other tan HTML. For example, if your New Page screen is defaulting to .php pages, you'll need to modify the Default.php file.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 0
Participant ,
Dec 06, 2018

Copy link to clipboard

Copied

Yes, I set the "new document" to a HTML5 file:

Dropbox - Screenshot 2018-12-06 23.04.56.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 0
Participant ,
Dec 06, 2018

Copy link to clipboard

Copied

No, I like to use HTML5, with all it's elements and not XHTML anymore.

<br /> is valid HTML5. So I like to realize it with DW.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 0
Adobe Community Professional ,
Dec 06, 2018

Copy link to clipboard

Copied

<br /> =  XHTML syntax. 

Don't expect DW's auto code completion to assist you with that syntax in HTML5 doc types because it's not the W3C standard.  However If you code manually,  you can do whatever you want.

EDIT:  To see the line break, switch to Live View.

Nancy O'Shea, ACP
Alt-Web Design & Publishing

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 0
Participant ,
Dec 06, 2018

Copy link to clipboard

Copied

<br /> is a valid syntax for a void element in HTML5:
HTML syntax - HTML5

Because you wrote "if you code manually":

I meant the auto completion in the code view.

If anyone has an idea, how to solve the 3 unsolved tasks (normalizing autocompletion of br, editing template for CMD+N, non-breaking space with CMD+SHIFT+SPACE as unicode character), I would appreciate hints.

Thanks

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 06, 2018 0
Adobe Community Professional ,
Dec 07, 2018

Copy link to clipboard

Copied

as Nancy already told you , in HTML5 the void TAG don't need any closing slash... either the link that you forward explicit said that the slash is optional...

so... if anyway you need and want the closing slah in the BR tag, you just have to edit the file C:\Program Files\Adobe\Adobe Dreamweaver CC Next\configuration\Objects\Characters\Line Break.htm

by replacing <br> by <br />

concerning the default document association as someone already said you, you will have to edit the corresponding file located in the folder C:\Program Files\Adobe\Adobe Dreamweaver CC Next\configuration\DocumentTypes\NewDocuments, you can also create you own new one by adding it to the file C:\Program Files\Adobe\Adobe Dreamweaver CC Next\configuration\DocumentTypes\MMDocumentTypes.xml and adding your model to the previous folder too. if that is not what you're asking for, could you please describe it differently to help me understand what you're exactly looking for

last, when hitting CTRL SHIFT SPACE it enter as expected a  &nbsp; what are you expecting different ?...12.07.2018-09.38.19

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 07, 2018 0
Participant ,
Dec 07, 2018

Copy link to clipboard

Copied

Thanks for your detailed answer.

br
You missunderstand my point in that case. I know that a slash is optional in br. I only want it, because it's safer in a special context.
I edited the mentioned file /Applications/Adobe/Adobe Dreamweaver CC 2014/configuration/Objects/Characters/Line Break.htm
Please see the code below. But is has no effect to the design view. When I press SHIFT+ENTER, a <br> is inserted.

May be it is not the correct file on my localized (German) version.
When I edit it to <br> it has no effect neither to the code view.

new document

I solved the problem
The path must be the following:
/Applications/Adobe Dreamweaver CC 2014/de_DE/Configuration/DocumentTypes/NewDocuments/Default.html
and not
/Applications/Adobe Dreamweaver CC 2014/Configuration/DocumentTypes/NewDocuments/Default.html
Now it works fine.

non breaking spaceI expect, as I wrote, the unicode character and not the entity. I can't describe it better, sorry.
May be it helps to mention, that DW display a little gray circle as a placeholder for the unicode character of the non breaking space in the code view.

Code of "Line Break.htm"

<!-- MENU-LOCATION=NONE -->

<html xmlns:MMString="http://www.macromedia.com/schemes/data/string/">

<head>

<!-- Copyright 2000, 2001, 2002, 2003 Macromedia, Inc. All rights reserved. -->

<title><MMString:LoadString id="insertbar/linebreak" /></title>

</head>

<script language="javascript">

function isDOMRequired() {

    // Return false, indicating that this object is available in code view.

    return false;

}

function objectTag() {

  // Return the html tag that should be inserted

  return "<br />";

}

</script>

<body>

</body>

</html>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 07, 2018 1
Participant ,
Dec 07, 2018

Copy link to clipboard

Copied

I'm one step further with "br".

To manipulate the inserted tag for SHIFT+ENTER in the code view it is neccessary to create the following new file, when you use a localized version like me.

/Applications/Adobe Dreamweaver CC 2014/de_DE/Configuration/Objects/Characters/Line Break.htm

But:
That file does not manipulate the inserted Tag in the design view, only in the code view.

Is there any way to manipulate the inserted tag in the design view?


Again back to the second open task, the non breaking space:
Do you see any way to get the unicode character with CMD+SHIFT+SPACE, of course as well in the design view and in the code view.
Entities are so ugly and should only be used, when that can't be avoided.

What did I try?

I edited
/Applications/Adobe Dreamweaver CC 2014/de_DE/Configuration/Objects/Characters/NBSP.htm
and
/Applications/Adobe Dreamweaver CC 2014/Configuration/Objects/Characters/NBSP.htm

var nbspChar = "&nbsp";

to

var nbspChar = " ";

I has no effect to CMD+SHIFT+SPACE

I would like to solve a fourth task, which is related to the NBSP:

Typing a " on the keyboard should insert a " in the code view instead of &quot;

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 07, 2018 0
Participant ,
Dec 08, 2018

Copy link to clipboard

Copied

Someone in the thread wanted to know, what I expect with "the unicode character", when I type SHIFT+ENTER in the code view.
Please look at: Dropbox - Screenshot 2018-12-08 09.52.18.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 08, 2018 0
Participant ,
Dec 10, 2018

Copy link to clipboard

Copied

Does really no one has an idea how to solve the task with changing the behaviour of CMD+SHIFT+SPACE in the described manner?

I would like so much to get access to that behaviour.

May be I should better open a new thread, because the subject is about something else.

Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Dec 10, 2018 0