6 Replies Latest reply: Jul 5, 2014 12:17 PM by jyeager11 RSS

    "Dreamweaver-only" code...

    jyeager11 Community Member

      I'm a PHP beginner who is keeping most of his strings in a separate file. In other words, I have a main PHP file calling a smaller PHP file that contains all the strings.

       

      The main file as the usual <?php ?> tags you would expect from a PHP file. But the strings file doesn't, because it's an include and those tags would cause errors.

       

      But when I work on the strings file, I want Dreamweaver's color codes to kick in (instead of the text all being black, since there are no headers instructing Dreamweaver on what kind of file this is).

       

      Is there a way for me to add the <?php ?> tags to the strings file in such a way that only Dreamweaver will see them?

       

      (In other words, the server and browsers ignore this code, it's for Dreamweaver editing purposes only.)

       

      I could've sworn Dreamweaver had this functionality many years ago, I just don't remember what it's called.

        • 1. Re: "Dreamweaver-only" code...
          Nancy O. CommunityMVP

          Why are you making this so difficult?  If you want code hinting and formatting, simply add <php? tag to the include file.  Remove the extra <php? tag from your parent page.  Problem solved.

           

          Nancy O.

          • 2. Re: "Dreamweaver-only" code...
            jyeager11 Community Member

            Could you at least tell me if the feature I am describing exists, and what it's called? Code that only Dreamweaver can see. The uses would go well beyond this one example.

            • 3. Re: "Dreamweaver-only" code...
              Nancy O. CommunityMVP

              DW proprietary code is limited to things like Templates and Library Items.  But those won't help with this scenario.

               

               

              Nancy O. 

              • 4. Re: "Dreamweaver-only" code...
                osgood_ CommunityMVP

                I don't follow.

                 

                If I have the below in my main page (which calls the code in the file.php document into the main page)

                 

                <?php include ('file.php'); ?>

                 

                I can still have php tags in the file.php document:

                 

                <?php

                echo "<h1>Hello World</h1>";

                ?>

                 

                No errors, The page will just print - <h1>Hello World</h1>

                 

                 

                Please provide an example of what it is you are doing.

                • 5. Re: "Dreamweaver-only" code...
                  Nancy O. CommunityMVP

                  osgood_ wrote:

                   

                  I don't follow.

                   

                  Me neither.  There's no reason to omit php tags from the include file.  It serves no purpose whatsoever.

                   

                  Nancy O.

                  • 6. Re: "Dreamweaver-only" code...
                    jyeager11 Community Member

                    Okay, it was a mistake for me to go into so much detail with my problem. Adobe doesn't allow us to edit original posts, so I can't do anything about it now except ask you to ignore it.

                     

                    I remembered there was something I thought might be useful here that I've used in the past... but couldn't remember what it was. Now I do. It was design-time stylesheets. And now that I remember what they were, I see they won't be much use to me here.

                     

                    I guess I was looking for "design-time code" but such a thing does not exist.

                     

                    Thanks for the answers!