3 Replies Latest reply on Nov 4, 2013 3:11 PM by Rik Ramsay

    Dreamweaver for HTML fragments

    spittendrigh

      How can I use Dreamweaver to create HTML fragments files, with no HTML,HEAD or BODY elements?

       

      These fragments would be uploaded to a server-side content management system.

      Such systems typically use supposedly wysiwyg javascript editors like tinyMCE.  But Dreamweaver makes far better HTML codes.

      So I want to use Dreamweaver on the client and then upload the fragments.

       

      I know how to make uploads go to the right place. I'm not a Dreamweaver user (much) and I can't figure out how to get rid of HTML, HEAD and BODY.  And I don't want to have to use string replace on the server.

        • 1. Re: Dreamweaver for HTML fragments
          Rik Ramsay Level 4

          Dreamweaver has Snippets, which are just blocks of code that you create and can insert anywhere you like. You can see them by going to Windows > Snippets. You can add/remove/edit within the panel.

           

          As for creating a new file, why not just remove the code you do not want? This is similar to server-side includes were you use Dreamweaver to create the file with no head or body tags.

          • 2. Re: Dreamweaver for HTML fragments
            spittendrigh Level 1

            Thank you!

             

            My windows machine (and therefore Dreamweaver) is temporily down.  Infected with a default search engine virus. Probably now part of a botnet too.

            So I can't reboot it until after a re-install from bare metal operation. Which I won't have time for until later in the week.

             

            So I can't test your helpful suggestions just yet. Snippets sounds great.

             

            But your last sentence is vague.  "As for creating a new file, why not just remove the code you do not want? This is similar to server-side includes were you use Dreamweaver to create the file with no head or body tags."

             

            Well yes. But I couldn't find out how to do that ("why not just remove...."). 

            I know I'm missing something.

            • 3. Re: Dreamweaver for HTML fragments
              Rik Ramsay Level 4

              spittendrigh wrote:

              Well yes. But I couldn't find out how to do that ("why not just remove...."). 

              I know I'm missing something.

              Without sounding condescending, simply open the page in code view, select what you don't want, and hit delete. You can then save the file without all the stuff you don't need.

              1 person found this helpful