Copy link to clipboard
Copied
When I try to apply source formatting, nothing gets formatted.
Is there any way for me to debug this - to figure you what in my code is causing it to fail?
Copy link to clipboard
Copied
What kind of file is it?
If it's HTML, use the built-in validation service. Go to Window > Results > Validation. Click on the white triangle to check your document. Fix all reported errors.
Copy link to clipboard
Copied
Nancy - It's a PHP file. There are no errors or warnings reported by validation. This is not caused by invalid HTML or PHP code.
Copy link to clipboard
Copied
Which version of DW?
Did you format PHP tag libraries before running Apply Source Formatting?
Copy link to clipboard
Copied
It's the latest version.
i have never looked the code tag libraries.
I can't imagine that in building the tool there was no debug facility
Copy link to clipboard
Copied
I should mention that it works on a stripped down version of the page with only a few lines on HTML, PHP, and Template commands.
Copy link to clipboard
Copied
Hi,
We need to see the full page/source code really to help with this.... Can you post it?
Copy link to clipboard
Copied
As far as I know DW doesnt specifically have a debugger for php, you'd have to use something like Xdebug. I dont know if DW has any options for executing Xdebug.
On the other hand I doubt debugging has anything to do with applying code source formatting or stopping it from working.
Copy link to clipboard
Copied
Is your PHP a pure PHP file or does it contain HTML code?
if it's only PHP, it's been working pretty well (out of the box) for a few versions. then it's a matter of personal wishes and expectations that can easily be edited to refine the result.https://helpx.adobe.com/in/dreamweaver/user-guide.html/in/dreamweaver/using/format-code.ug.html
but as soon as PHP and HTML code is mixed, and depending on your method of block organization, it becomes more peculiar and often messy than we would expect. on this subject, if someone has a solution, I'll take it... thank you 😉
Copy link to clipboard
Copied
Folks - I have clearly failed to make myself clear. This is only about the "Apply Source Formatting" tool. I like to use it to line up all the indents, lists, etc.
I'm using DW 21 (with a template), PHP, CSS3, Windows 10, with local and remote servers defined.
One interesting fact is that "Apply Source Formatting" works fine on the template.
Copy link to clipboard
Copied
So you're trying to Apply Code Formatting to a Template CHILD page. That's a horse of a different color. Only code inside an Editable Region will be effected. Everything outside Editable Regions is necessarily controlled by your main Template.dwt.
For best results, Apply Code Formatting to the Template.dwt and populate changes to child pages.
Copy link to clipboard
Copied
Nancy - I only expect it to work on code within editable regions. But it doesn't.
There is a significant amount of code within the editable regions that I need it to work on.
Copy link to clipboard
Copied
Oh, and the template syntax is correct, according to DW.
Copy link to clipboard
Copied
Since this only happens with one site, the site template could be corrupted.