Highlighted

Apply source formatting does not affect files ending in .php

Community Beginner ,
Jan 19, 2019

Copy link to clipboard

Copied

Please -

I don't know how to get help with this issue.  I've seen several posts, but others seem unconcerned about it, and bug reports get no responses.

When I open a file with the extension .php,  e.g. index.php, and choose Apply Source Formatting, absolutely nothing happens!

This used to work fine, but quit when I went to DW CC.  I am currently using Dreamweaver CC 19, build 11193 on Windows 10.

I don't know if there is some option I need to change, or if this is by design, or if it's a bug.  I submitted a bug request, but it was not responded to and I can't see how to follow up on it.  The documentation seems to imply it should work.

Anyone have any advice or suggestions for moving forward?

Bert Onstott

Adobe Community Professional
Correct answer by Paul-M | Adobe Community Professional

Views

949

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

Apply source formatting does not affect files ending in .php

Community Beginner ,
Jan 19, 2019

Copy link to clipboard

Copied

Please -

I don't know how to get help with this issue.  I've seen several posts, but others seem unconcerned about it, and bug reports get no responses.

When I open a file with the extension .php,  e.g. index.php, and choose Apply Source Formatting, absolutely nothing happens!

This used to work fine, but quit when I went to DW CC.  I am currently using Dreamweaver CC 19, build 11193 on Windows 10.

I don't know if there is some option I need to change, or if this is by design, or if it's a bug.  I submitted a bug request, but it was not responded to and I can't see how to follow up on it.  The documentation seems to imply it should work.

Anyone have any advice or suggestions for moving forward?

Bert Onstott

Adobe Community Professional
Correct answer by Paul-M | Adobe Community Professional

Views

950

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
Jan 19, 2019 0
Adobe Community Professional ,
Jan 19, 2019

Copy link to clipboard

Copied

I know this doesn't help you much. I'm on Windoes 10 and the same version of Dreamweaver and Apply Source Formatting is working for me with PHP files.

Have tried Apply Source formatting on multiple files or tried creating a very simply PHP page and see if it works?

Paul-M, ACP

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...
Jan 19, 2019 1
Community Beginner ,
Jan 19, 2019

Copy link to clipboard

Copied

That's really odd.  I wonder why it does not work for me? It seems there is no chat or phone support available for 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...
Jan 19, 2019 0
Adobe Community Professional ,
Jan 19, 2019

Copy link to clipboard

Copied

My experience is that using the apply source formatting on PHP pages does weird things to my code, worse case scenario is sometimes its broken PHP code completely . I have never come across it not working at all tbh but you're not the first to report it. You could try Nancy's workaround of changing the extension of your file(s) temporarily.

I use a different program if I need to format PHP pages, due to issues with PHP code and the apply source formatting tool in Dreamweaver

I would also add your weight to the the Dreamweaver uservoice website, the theory is the more people that report an issue the higher priority it should get.

Paul-M, ACP

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...
Jan 19, 2019 1
Adobe Community Professional ,
Jan 19, 2019

Copy link to clipboard

Copied

That's really odd.  I wonder why it does not work for me? It seems there is no chat or phone support available for DW.

Contact Customer Care

Paul-M, ACP

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...
Jan 19, 2019 1
Adobe Employee ,
May 24, 2019

Copy link to clipboard

Copied

Hi Paul_M,

We have shared a latest release 15104 on Dreamweaver Prerelease. This release contains some more fixes for PHP code formatting and it is a more stabilized build for PHP formatting.

Can you please give it a try and let us know your feedback.

Thanks

Dreamweaver Team.

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...
May 24, 2019 0
Community Beginner ,
May 27, 2019

Copy link to clipboard

Copied

Where do I download that version?

Bert Onstott

[E-mail signature removed by moderator.]

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...
May 27, 2019 0
Adobe Employee ,
May 30, 2019

Copy link to clipboard

Copied

Hi BROnstott,

Please find below the invitation link to Prerelease forum,

Adobe Prerelease

You can download the build from Adobe Prerelease forum

Adobe Prerelease

Thanks

Dreamweaver Team

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...
May 30, 2019 0
Adobe Employee ,
Jun 17, 2019

Copy link to clipboard

Copied

Hi,

we are happy to inform you that we have addressed a couple of PHP bug fixes in our latest release 19.2.0.11274 which can be downloaded from creative cloud.

Please give it a try and let us know if your issue is fixed and share your feedback.

Regards

Dreamweaver Team

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...
Jun 17, 2019 0
Adobe Community Professional ,
Jan 19, 2019

Copy link to clipboard

Copied

As you can tell from the link below, this is a known bug. 

Adobe Dreamweaver: Bugs: Hot (997 ideas) – Adobe Dreamweaver CC: Feature Ideas

One workaround, save file as .html, apply source formatting and then save as .php file.

Another workaround,  revert to an older version of DW from CC Desktop App.

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...
Jan 19, 2019 1
Community Beginner ,
Jan 19, 2019

Copy link to clipboard

Copied

Nancy - The bug you referenced is unrelated to mine. 

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...
Jan 19, 2019 0
Adobe Community Professional ,
Jan 19, 2019

Copy link to clipboard

Copied

just to add to what has already been said, check your document to make sure that there are no coding errors, Dreamweaver tends to misbehave when an error is encountered.

To check, go to Ready to check - Nu Html Checker


Ben

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...
Jan 19, 2019 1
Community Beginner ,
Jan 20, 2019

Copy link to clipboard

Copied

Thanks for the ideas.

I just tried renaming the file to index.htm, and it turns out it still doesn't work.  So there must be something wrong with my site, the page, or my installation of DW.  Sorry - should have tried this before.

The code is pretty 220 lines long, so not sure it would help to post it here, but here's a link to the published page. There is almost no PHP code in that page; just a copyright reference inserting the date.

I did validate it and it shows no errors or warnings, both using the built in DW validator and the one suggested by Ben.  It is using html5.

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...
Jan 20, 2019 0
Adobe Community Professional ,
Jan 20, 2019

Copy link to clipboard

Copied

That looks like a Template child page.

Can you format code in your main template?

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...
Jan 20, 2019 0
Community Beginner ,
Jan 20, 2019

Copy link to clipboard

Copied

Nancy - Yes I can.  Just tried it and it worked.

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...
Jan 20, 2019 0
Community Beginner ,
Feb 03, 2019

Copy link to clipboard

Copied

I think I've narrowed down the behavior.

  • If I create a new php page, called text.php, Format Source Code works fine.
  • If I then duplicate that file to test - copy.php and use Tools/Template/Apply Template to Page,  Format Source Code no longer works.
  • If I then use duplicate that file to test - copy[2].php and use Tools/Template/Detach from Template, it starts working again.
  • The contents of each file is shown below.

The only difference between test - copy and test - copy[2]  seems to be that the template commands are removed and the source has ben formatted.

So it seems that it has something to do with using templates?  Can anyone shed any light on what's going on here?

test.php

<!doctype html>

<html lang="en">

<head>

    <meta charset="utf-8">

    <title>Untitled Document</title>

</head>

<body>

</body>

</html>

test - copy.php after applying the template:

<!DOCTYPE html>

<html lang="en"><!-- InstanceBegin template="/Templates/design_template.dwt" codeOutsideHTMLIsLocked="false" -->

<head>

<meta charset="UTF-8">

<meta name="Keywords" content="Bridge, Cards, Games, Duplicate bridge, Classes, Contract Bridge, Houston, ACBL, Duplicate, Unit 174, District 16, Texas, Results, Bridge Club, scores" />

<link rel="icon"

      type="image/ico"

      href="favicon.ico" />

<!-- InstanceBeginEditable name="doctitle" -->

<title>WBA Template</title>

<!-- InstanceEndEditable -->

<link rel="stylesheet" type="text/css" href="CSS/stylesheet.css" property="stylesheet">

<!-- InstanceBeginEditable name="head" -->

<meta name="google-site-verification" content="n4eaQJ8oukLrfC1H_bEyQU3Sjm6SVbRhIUscLAA3dq4" />

<!-- InstanceEndEditable -->

<!-- InstanceParam name="id" type="text" value="Page_ID" -->

<link href="Spry-UI-1.7/css/Menu/basic/SpryMenuBasic.css" rel="stylesheet" type="text/css" />

<script src="Spry-UI-1.7/includes/SpryDOMUtils.js" ></script>

<script src="Spry-UI-1.7/includes/SpryDOMEffects.js" ></script>

<script src="Spry-UI-1.7/includes/SpryWidget.js" ></script>

<script src="Spry-UI-1.7/includes/SpryMenu.js" ></script>

<script src="Spry-UI-1.7/includes/plugins/MenuBar2/SpryMenuBarKeyNavigationPlugin.js" ></script>

<script src="Spry-UI-1.7/includes/plugins/MenuBar2/SpryMenuBarIEWorkaroundsPlugin.js" ></script>

<link href="CSS/WBAmenu.css" rel="stylesheet" type="text/css" />

<script type="text/xml">

<!--

<oa:widgets>

  <oa:widget wid="2141544" binding="#WBA_Menu" />

</oa:widgets>

-->

</script>

</head>

<body id="Page_ID">

<div class="container">

    <div class="bannerArea"> </div>

    <!--End bannerArea div -->

    <div class="Menu">

        <ul id="WBA_Menu">

            <li><a href="index.php">Home</a></li>

            <li><a href="#">Who's Who</a>

                <ul>

                    <li><a href="Owners.php">Owners</a></li>

                    <li><a href="Directors.php">Directors</a></li>

                    <li><a href="Teachers.php">Teachers</a></li>

                </ul>

            </li>

            <li><a href="Contact_us.php">Contact us</a></li>

            <li><a href="Schedule.php">Game Schedule</a></li>

            <li><a href="Class_Schedule.php">Class Schedule</a></li>

            <li><a href="#">Scores</a>

                <ul>

                    <li><a href="January.php">January</a></li>

                    <li><a href="February.php">February</a></li>

                    <li><a href="March.php">March</a></li>

                    <li><a href="April.php">April</a></li>

                    <li><a href="May.php">May</a></li>

                    <li><a href="June.php">June</a></li>

                    <li><a href="July.php">July</a></li>

                    <li><a href="August.php">August</a></li>

                    <li><a href="September.php">September</a></li>

                    <li><a href="October.php">October</a></li>

                    <li><a href="November.php">November</a></li>

                    <li><a href="December.php">December</a></li>

                </ul>

            </li>

            <li><a href="http://thecommongame.com/clubwebhost/271239/">Common Game Results</a></li>

            <li><a href="#">Power Ratings</a>

                <ul>

                    <li><a href="https://www.bridgepowerratings.com/PRhome.HTM">Home Page</a></li>

                    <li><a href="https://www.bridgepowerratings.com/WEBPAGES/GAMES/PWS_LBRY.htm">WBA Games</a></li>

                    <li><a href="https://www.bridgepowerratings.com/WEBPAGES/U174WEB/U174RANK.htm">Unit 174 Ratings</a></li>

                </ul>

            </li>

            <li><a href="Score_Corrections.php">Score Corrections</a></li>

            <li><a href="Mentor-Mentee.php">Mentor-Mentee</a></li>

            <li><a href="Eight_is_Enough.php">8 is Enough</a></li>

            <li><a href="Partnership.php">Partnership</a></li>

            <li><a href="WBA_LIbrary.php">WBA Library</a></li>

            <li><a href="Parking.php">Parking</a></li>

            <li><a href="Photo_Gallery.php">Photo Gallery</a></li>

            <li><a href="Mailing_List.php">Join our mailing list</a></li>

            <li><a href="Gary_King_Email.php">Join Gary King's mailng list</a></li>

            <li><a href="Jeff_Kroll_Newsletters.php">Jeff Kroll's Newsletters</a></li>

            <li><a href="Charity.php">Charitable Donations</a></li>

            <li><a href="#">Online Bridge Links</a>

                <ul>

                    <li><a href="http://www.acbl.org/">ACBL</a></li>

                    <li><a href="http://www.d16acbl.org/">District 16</a></li>

                    <li><a href="http://www.acblunit174.org/index.html">Unit 174</a></li>

                    <li><a href="http://www.worldbridge.org/">World Bridge Federation</a></li>

                    <li><a href="http://www.bridgebase.com/">BBO</a></li>

                    <li><a href="http://www.okbridge.com/">OKBridge</a></li>

                    <li><a href="http://www.barbaraseagram.com/">Barbara Seagram</a></li>

                    <li><a href="http://bridgewinners.com/">Bridge Winners</a></li>

                    <li><a href="http://www.bridgebum.com/">Bridge Bum</a></li>

                    <li><a href="http://www.michaelslawrence.com/">Mike Lawrence</a></li>

                    <li><a href="http://www.gwilliams.org.uk/">Conventions</a></li>

                    <li><a href="http://www.bridgeguys.com/glossbridgemain.html">Bridge Guys</a></li>

                    <li><a href="http://www.bridgetalk.com/">Bridge Talk</a></li>

                    <li><a href="http://www.kantarbridge.com/">Eddie Kantar</a></li>

                    <li><a href="http://bridgewinners.com/commongame/">Common Game Forum</a></li>

                </ul>

            </li>

            <li><a href="Ambassador_Schedule.php">Ambassador Schedule</a></li>

            <li><a href="Slow_Play.php">Slow Play Policy</a></li>

            <li><a href="Zero_Tolerance.php">Zero Tolerance</a></li>

        </ul>

        <!-- end Menu div -->

    </div>

    <!-- InstanceBeginEditable name="content" -->

    <div class="maincontent">

        <p> </p>

          <p> </p>

    </div>

    <!--End maincontent div -->

    <!-- InstanceEndEditable -->

    <div style="clear:both;"></div>

    <div class="footerArea">

        <div class="copyright">

            <p>&copy; <?php echo date("Y");  ?> Westside Bridge Academy.  All rights reserved.</p>

        </div>

        <!-- end footerArea div -->

    </div>

    <!-- End container div -->

</div>

<script>

// BeginOAWidget_Instance_2141544: #MenuBar

      var MenuBar = new Spry.Widget.MenuBar2("#WBA_Menu", {

      widgetID: "WBA_Menu",

      widgetClass: "MenuBar MenuBarVertical WBA_MenuMenuBarVerticalLeftShrink",

      insertMenuBarBreak: true,

      mainMenuShowDelay: 200,

      mainMenuHideDelay: 200,

      subMenuShowDelay: 200,

      subMenuHideDelay: 200

      });

// EndOAWidget_Instance_2141544

      </script>

<!-- InstanceBeginEditable name="Scripts" --> <!-- InstanceEndEditable -->

<!-- end container div -->

</body>

<!-- InstanceEnd --></html>

test - copy[2].php after detaching from the template:

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="Keywords" content="Bridge, Cards, Games, Duplicate bridge, Classes, Contract Bridge, Houston, ACBL, Duplicate, Unit 174, District 16, Texas, Results, Bridge Club, scores"/>

    <link rel="icon" type="image/ico" href="favicon.ico"/>

    <title>WBA Template</title>

    <link rel="stylesheet" type="text/css" href="CSS/stylesheet.css" property="stylesheet">

    <meta name="google-site-verification" content="n4eaQJ8oukLrfC1H_bEyQU3Sjm6SVbRhIUscLAA3dq4"/>

    <link href="Spry-UI-1.7/css/Menu/basic/SpryMenuBasic.css" rel="stylesheet" type="text/css"/>

    <script src="Spry-UI-1.7/includes/SpryDOMUtils.js"></script>

    <script src="Spry-UI-1.7/includes/SpryDOMEffects.js"></script>

    <script src="Spry-UI-1.7/includes/SpryWidget.js"></script>

    <script src="Spry-UI-1.7/includes/SpryMenu.js"></script>

    <script src="Spry-UI-1.7/includes/plugins/MenuBar2/SpryMenuBarKeyNavigationPlugin.js"></script>

    <script src="Spry-UI-1.7/includes/plugins/MenuBar2/SpryMenuBarIEWorkaroundsPlugin.js"></script>

    <link href="CSS/WBAmenu.css" rel="stylesheet" type="text/css"/>

    <script type="text/xml">

        <!--

<oa:widgets>

  <oa:widget wid="2141544" binding="#WBA_Menu" />

</oa:widgets>

-->

    </script>

</head>

<body id="Page_ID">

    <div class="container">

        <div class="bannerArea"> </div>

        <!--End bannerArea div -->

        <div class="Menu">

            <ul id="WBA_Menu">

                <li><a href="index.php">Home</a>

                </li>

                <li><a href="#">Who's Who</a>

                    <ul>

                        <li><a href="Owners.php">Owners</a>

                        </li>

                        <li><a href="Directors.php">Directors</a>

                        </li>

                        <li><a href="Teachers.php">Teachers</a>

                        </li>

                    </ul>

                </li>

                <li><a href="Contact_us.php">Contact us</a>

                </li>

                <li><a href="Schedule.php">Game Schedule</a>

                </li>

                <li><a href="Class_Schedule.php">Class Schedule</a>

                </li>

                <li><a href="#">Scores</a>

                    <ul>

                        <li><a href="January.php">January</a>

                        </li>

                        <li><a href="February.php">February</a>

                        </li>

                        <li><a href="March.php">March</a>

                        </li>

                        <li><a href="April.php">April</a>

                        </li>

                        <li><a href="May.php">May</a>

                        </li>

                        <li><a href="June.php">June</a>

                        </li>

                        <li><a href="July.php">July</a>

                        </li>

                        <li><a href="August.php">August</a>

                        </li>

                        <li><a href="September.php">September</a>

                        </li>

                        <li><a href="October.php">October</a>

                        </li>

                        <li><a href="November.php">November</a>

                        </li>

                        <li><a href="December.php">December</a>

                        </li>

                    </ul>

                </li>

                <li><a href="http://thecommongame.com/clubwebhost/271239/">Common Game Results</a>

                </li>

                <li><a href="#">Power Ratings</a>

                    <ul>

                        <li><a href="https://www.bridgepowerratings.com/PRhome.HTM">Home Page</a>

                        </li>

                        <li><a href="https://www.bridgepowerratings.com/WEBPAGES/GAMES/PWS_LBRY.htm">WBA Games</a>

                        </li>

                        <li><a href="https://www.bridgepowerratings.com/WEBPAGES/U174WEB/U174RANK.htm">Unit 174 Ratings</a>

                        </li>

                    </ul>

                </li>

                <li><a href="Score_Corrections.php">Score Corrections</a>

                </li>

                <li><a href="Mentor-Mentee.php">Mentor-Mentee</a>

                </li>

                <li><a href="Eight_is_Enough.php">8 is Enough</a>

                </li>

                <li><a href="Partnership.php">Partnership</a>

                </li>

                <li><a href="WBA_LIbrary.php">WBA Library</a>

                </li>

                <li><a href="Parking.php">Parking</a>

                </li>

                <li><a href="Photo_Gallery.php">Photo Gallery</a>

                </li>

                <li><a href="Mailing_List.php">Join our mailing list</a>

                </li>

                <li><a href="Gary_King_Email.php">Join Gary King's mailng list</a>

                </li>

                <li><a href="Jeff_Kroll_Newsletters.php">Jeff Kroll's Newsletters</a>

                </li>

                <li><a href="Charity.php">Charitable Donations</a>

                </li>

                <li><a href="#">Online Bridge Links</a>

                    <ul>

                        <li><a href="http://www.acbl.org/">ACBL</a>

                        </li>

                        <li><a href="http://www.d16acbl.org/">District 16</a>

                        </li>

                        <li><a href="http://www.acblunit174.org/index.html">Unit 174</a>

                        </li>

                        <li><a href="http://www.worldbridge.org/">World Bridge Federation</a>

                        </li>

                        <li><a href="http://www.bridgebase.com/">BBO</a>

                        </li>

                        <li><a href="http://www.okbridge.com/">OKBridge</a>

                        </li>

                        <li><a href="http://www.barbaraseagram.com/">Barbara Seagram</a>

                        </li>

                        <li><a href="http://bridgewinners.com/">Bridge Winners</a>

                        </li>

                        <li><a href="http://www.bridgebum.com/">Bridge Bum</a>

                        </li>

                        <li><a href="http://www.michaelslawrence.com/">Mike Lawrence</a>

                        </li>

                        <li><a href="http://www.gwilliams.org.uk/">Conventions</a>

                        </li>

                        <li><a href="http://www.bridgeguys.com/glossbridgemain.html">Bridge Guys</a>

                        </li>

                        <li><a href="http://www.bridgetalk.com/">Bridge Talk</a>

                        </li>

                        <li><a href="http://www.kantarbridge.com/">Eddie Kantar</a>

                        </li>

                        <li><a href="http://bridgewinners.com/commongame/">Common Game Forum</a>

                        </li>

                    </ul>

                </li>

                <li><a href="Ambassador_Schedule.php">Ambassador Schedule</a>

                </li>

                <li><a href="Slow_Play.php">Slow Play Policy</a>

                </li>

                <li><a href="Zero_Tolerance.php">Zero Tolerance</a>

                </li>

            </ul>

            <!-- end Menu div -->

        </div>

        <div class="maincontent">

            <p> </p>

            <p> </p>

        </div>

        <!--End maincontent div -->

        <div style="clear:both;"></div>

        <div class="footerArea">

            <div class="copyright">

                <p>&copy;

                    <?php echo date("Y");  ?> Westside Bridge Academy. All rights reserved.</p>

            </div>

            <!-- end footerArea div -->

        </div>

        <!-- End container div -->

    </div>

    <script>

        // BeginOAWidget_Instance_2141544: #MenuBar

        var MenuBar = new Spry.Widget.MenuBar2( "#WBA_Menu", {

            widgetID: "WBA_Menu",

            widgetClass: "MenuBar MenuBarVertical WBA_MenuMenuBarVerticalLeftShrink",

            insertMenuBarBreak: true,

            mainMenuShowDelay: 200,

            mainMenuHideDelay: 200,

            subMenuShowDelay: 200,

            subMenuHideDelay: 200

        } );

        // EndOAWidget_Instance_2141544

    </script>

    <!-- end container div -->

</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...
Feb 03, 2019 0
Adobe Community Professional ,
Feb 03, 2019

Copy link to clipboard

Copied

You should be able to format code inside design_template.php.dwt

However template child pages are not editable except within defined Editable Regions.  All the rest of the code is locked or grayed out.  That's why code formatting doesn't work on template child pages.

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...
Feb 03, 2019 1
Community Beginner ,
Feb 03, 2019

Copy link to clipboard

Copied

Nancy -

Yes, I can format the template.  And the code I want to format is between TemplateBeginEditable and TemplateEndEditable tags and should be formatable.  I didn't mention that when, checked, the template syntax is correct.

<!-- TemplateBeginEditable name="content" -->
<div class="maincontent">
<p> </p>
<p> </p>
</div>
<!--End maincontent div -->
<!-- TemplateEndEditable -->

So I don't think that's the answer.

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...
Feb 03, 2019 0
Community Beginner ,
Mar 28, 2019

Copy link to clipboard

Copied

Folks -

Finally got around to addressing this again.  To isolate the issue, I created a simple php page, test.php, shown below:

<!doctype html>

<html lang="en">

<head>

    <meta charset="utf-8">

    <title>Test</title>

</head>

<body>

    <p>This is a test. </p>

</body>

</html>

I can use "Apply source formatting" to test.php with no problems.

I also created a simple template: test.dwt, shown below:

<!doctype html>

<html lang="en">

<head>

<meta charset="utf-8">

<title doctitle="@@(_document['Untitiled Document'])@@">Untitled Document</title>

<!-- TemplateParam name="Untitiled Document" type="text" value="" -->

</head>

<body>

<!-- TemplateBeginEditable name="Body" -->Body<!-- TemplateEndEditable -->

</body>

</html>

I can use "Apply source formatting" to test.dwt with no problems.

I then applied test.dwt to test.php and got test - copy.php, shown below:

<!doctype html>

<html lang="en"><!-- InstanceBegin template="/Templates/Test.dwt" codeOutsideHTMLIsLocked="false" -->

<head>

<meta charset="utf-8">

<title doctitle="Test with template applied">Untitled Document</title>

<!-- InstanceParam name="doctitle" type="text" value="Test with template applied" -->

</head>

<body>

<!-- InstanceBeginEditable name="Body" -->

  <p>This is a test.  </p>

<!-- InstanceEndEditable -->

</body>

<!-- InstanceEnd --></html>

If I use "Apply source formatting" to test - copy.php, nothing happens.  If I mess up the formatting of the single line of text in test - copy.php and try to format the code, nothing happens.

I have used templates for a long time - more than ten years, and they've always worked fine for me.  Specifically, "Apply source formatting" would format any code inside editable regions, while leaving the rest alone (as it should).

I have another site that still works as it used to, and another that doesn't.  Both use templates, but ones that don't work use html5 and the one's that do use  XHTML 1.0 Transitional.  I don't know if that's relevant, just passing it along.

Any help would be appreciated.

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...
Mar 28, 2019 0
Adobe Community Professional ,
Mar 28, 2019

Copy link to clipboard

Copied

You need to use 2 file extensions on templates containing PHP code.

Copy & paste the following code into a new, blank document.

File > SaveAs > Template.  Name it template.dwt.php  (2 extensions).

<!doctype html>

<html lang="en">

<head>

<meta charset="utf-8">

<!-- TemplateBeginEditable name="doctitle" -->

<title>Template Document</title>

<!-- TemplateEndEditable -->

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="viewport" content="width=device-width, initial-scale=1">

<style>

body {width: 80%; margin:0 auto}

</style>

<!-- TemplateBeginEditable name="head" -->

<!-- TemplateEndEditable -->

</head>

<body>

<header>

Sitewide header

</header>

<!-- TemplateBeginEditable name="EditRegion3"-->

<p>This is an editable region for page specific content. </p>

<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem magni saepe, distinctio, corporis dolorem voluptatibus architecto. Laboriosam unde est, architecto nemo numquam explicabo! Error dolores molestiae dolor esse mollitia iusto!</p>

<!-- TemplateEndEditable -->

<footer>

Sitewide footer. XYZ Website © 1995-

<?php echo date("Y");?> all rights reserved. </footer>

</body>

</html>

When formatting code, are you selecting HTML or PHP from  document drop list?  See screenshot.

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...
Mar 28, 2019 1
Community Beginner ,
Mar 28, 2019

Copy link to clipboard

Copied

There is no php code in the template.

Bert Onstott

[personal information removed by Moderator]

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...
Mar 28, 2019 0
Community Beginner ,
Mar 31, 2019

Copy link to clipboard

Copied

That dropdown box does not appear.

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...
Mar 31, 2019 0
Community Beginner ,
May 11, 2019

Copy link to clipboard

Copied

OK, I recreated the template by using test.php and saving it as a template; it got named as you said: test.dwt.php. 

Then I opened test-copy.php and tried to format source.  Same behavior.as before.

This is test.dwt.php:

<!doctype html>

<html lang="en">

<head>

    <meta charset="utf-8">

<!-- TemplateBeginEditable name="doctitle" -->

    <title>Test</title>

    <!-- TemplateEndEditable -->

    <!-- TemplateBeginEditable name="head" -->

    <!-- TemplateEndEditable -->

</head>

<body>

<!-- TemplateBeginEditable name="Body" -->

<p>This is a test. </p>

<!-- TemplateEndEditable -->

</body>

</html>

This is test.php:

<!doctype html>

<html lang="en">

<head>

    <meta charset="utf-8">

    <title>Test</title>

</head>

<body>

    <p>This is a test. </p>

</body>

</html>

and this is test - copy.php:

<!doctype html>

<html lang="en"><!-- InstanceBegin template="/Templates/Test.dwt.php" codeOutsideHTMLIsLocked="false" -->

<head>

    <meta charset="utf-8">

<!-- InstanceBeginEditable name="doctitle" -->

    <title>Test</title>

    <!-- InstanceEndEditable -->

    <!-- InstanceBeginEditable name="head" -->

    <!-- InstanceEndEditable -->

</head>

<body>

<!-- InstanceBeginEditable name="Body" -->

<p>This is a test.    

   

       </p>

<!-- InstanceEndEditable -->

</body>

<!-- InstanceEnd --></html>

Format source works perfectly on test.php and test.dwt.php and does exactly nothing to test-copy.php.

What am I missing?

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...
May 11, 2019 0
Adobe Community Professional ,
May 11, 2019

Copy link to clipboard

Copied

You can format code in a Template.dwt file but not a child page spawned from the template.  Only content inside editable regions are accessible from child pages.  All the rest is grayed out and cannot be accessed except from the main template.  

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...
May 11, 2019 0
Community Beginner ,
May 11, 2019

Copy link to clipboard

Copied

Nancy - If you will notice,

<p>This is a test.    

   

       </p>

is inside an editable region.  It should be formatted when I apply source formatting.  It isn't.

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...
May 11, 2019 0
Adobe Community Professional ,
May 11, 2019

Copy link to clipboard

Copied

You're not paying attention.  A child page cannot be formatted.  Sorry.  If you want to format a child page, open the Template, hit auto format.  Save and populate changes to child pages.

I use server-side includes instead of templates so I don't have these problems.

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...
May 11, 2019 0
Adobe Community Professional ,
May 11, 2019

Copy link to clipboard

Copied

Paul-M, ACP

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...
May 11, 2019 1
Community Beginner ,
May 11, 2019

Copy link to clipboard

Copied

Nancy -

You said "Only content inside editable regions are accessible from child pages".  The code that I want to Apply Source Formatting is inside the editable region.

I've done this for years.  I have other sites where it still works; they are xhtml transitional.

DW should format code inside editable regions for child pages.  And for some reason it isn't.   I

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...
May 11, 2019 0
Community Beginner ,
May 11, 2019

Copy link to clipboard

Copied

Thank you!  I thought I was losing my mind! 

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...
May 11, 2019 0
Adobe Community Professional ,
May 11, 2019

Copy link to clipboard

Copied

Thank you!  I thought I was losing my mind!

You're not There has been a lot of issues with source formatting, especially relating to PHP ...

Paul-M, ACP

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...
May 11, 2019 0
Adobe Community Professional ,
Jan 19, 2019

Copy link to clipboard

Copied

Paul-M, ACP

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...
Jan 19, 2019 0