• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Indentation

Community Beginner ,
Aug 22, 2018 Aug 22, 2018

Copy link to clipboard

Copied

When I create a new document, the pre-filled codes are not indented accordingly. How can I indent them "quickly and easily" instead of tabbing at each line? Periodically, when I open someones' else code and I want to do the same to indent and find it daunting to do so due to the length of the codes. I know it will still work if the code is not indented but it does make a difference when reading it. Thank you for helping.

Views

687

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
community guidelines

correct answers 1 Correct answer

Mentor , Aug 22, 2018 Aug 22, 2018

Dreamweaver 18:

Edit > Code > Apply Source Formatting

Dreamweaver CS6:

Commands > Apply Source Formatting

Votes

Translate

Translate
Mentor ,
Aug 22, 2018 Aug 22, 2018

Copy link to clipboard

Copied

Dreamweaver 18:

Edit > Code > Apply Source Formatting

Dreamweaver CS6:

Commands > Apply Source Formatting

Votes

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
community guidelines
Community Beginner ,
Aug 22, 2018 Aug 22, 2018

Copy link to clipboard

Copied

This is what I am looking for (except that I was trying at Edit > Code > Indent Code)

By the way, when I apply source formatting and I get the following :

<html>

<head>

<title>Bootstrap Demo - 1</title>

<meta charset="UTF-8">

Why is <head>, <title> and <meta> not indented like this?

<html>

  <head>

    <title>Bootstrap Demo - 1</title>

    <meta charset="UTF-8">

Votes

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
community guidelines
Mentor ,
Aug 22, 2018 Aug 22, 2018

Copy link to clipboard

Copied

jameshoty  wrote

Why is <head>, <title> and <meta> not indented like this?

<html>

  <head>

    <title>Bootstrap Demo - 1</title>

    <meta charset="UTF-8">

I've been coding pages for over 20 years and I have never indented tags outside the body. If you have a good reason for wanting to do it, you can probably edit your tag library... but logically, there is no usability benefit to it. I would leave the html and head tags alone.

The only thing I would seriously consider indenting... right off your page, actually... is Bootstrap

Votes

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
community guidelines
Community Expert ,
Aug 23, 2018 Aug 23, 2018

Copy link to clipboard

Copied

The snide remarks about Bootstrap aside, I don't indent HTML code either.  Personally, I see no point in it.   I just wish Dreamwaver would respect non-indented HTML code in my PHP files  .   I have to save as HTML and then back to PHP to remove the indents.   Kind of a nuisance.

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

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
community guidelines
Community Beginner ,
Aug 26, 2018 Aug 26, 2018

Copy link to clipboard

Copied

I came from old school where indentation is like army-foot drill. It has to be tidy and neat. Most website I visit, their codes are indented. However, this is really personal preference but I strongly envisage one day I will be battling with this when I work with other developers who do not practise this. Perhaps this is the usual experience for someone like me that started 3 weeks into this field.

Votes

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
community guidelines
Community Expert ,
Aug 27, 2018 Aug 27, 2018

Copy link to clipboard

Copied

I agree that DW needs to improve its code indentation a lot, starting by taking this setting out of preferences and taking it to the sites themselves, because not all production teams work with the same rules

Votes

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
community guidelines
LEGEND ,
Aug 27, 2018 Aug 27, 2018

Copy link to clipboard

Copied

https://forums.adobe.com/people/Nancy+OShea  wrote

I don't indent HTML code either.  Personally, I see no point in it.   I just wish Dreamwaver would respect non-indented HTML code in my PHP files  .   I have to save as HTML and then back to PHP to remove the indents.   Kind of a nuisance.

I never indent any code either. I like it ALL flush left and I don't want any editor changing how I want to work either!

Votes

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
community guidelines
Community Expert ,
Aug 27, 2018 Aug 27, 2018

Copy link to clipboard

Copied

if someone does not want indentation for code formatting (which is apparently the case of some of us around here), it is very easy to set the preferences parameters as such (indentation, space value, space type, etc. by resetting everything to none) and then apply code formatting....

the result will apply...in a perfect way and whatever the site is...

but for those of us who work with different teams and choose to indent their code, there is a big problem which is that on the one hand preferences are set at the global level and not at the level of each project (not all partners and teams have the same indentation rules and politics) and on the other hand parameters do not necessarily meet the needs when several languages are used within the same page, nor do they take into account all the languages offered by Dreamweaver.

so answer... it doesn't concern me, I don't use it, it doesn't fit my needs... is somewhere anti-constructive (this is neither an attack nor a provocation, to any one in particular ... it is just a remark)

Votes

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
community guidelines
Community Expert ,
Aug 27, 2018 Aug 27, 2018

Copy link to clipboard

Copied

LATEST

what is almost funny... if anyone connect to the prerelease forum (which is publicaly opened) he or she will constat, that a features request asking for such ameliorations on the code formating ... has been ... simply... closed by folks @adobe... funny isn't it ?

Adobe Prerelease

Votes

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
community guidelines