2 Replies Latest reply on Feb 8, 2010 5:34 AM by Fitz21

    Library, Snippets, or Another Way to Make References to Chunks of Code?

    Fitz21 Level 1

      Hi,

       

      I'm trying to decrease the overall length of code so my content copy appears higher up in the page from SE spiders' points of view.

       

      I have a site design that has Wrapper Div tag around the entire page, starting with a top banner (company graphic), followed by a horizontal Nav Menu (in a table with JavScript roll-overs) and then the main content (also in a Div tag). I'd like to move the main content much closer up the document for SEO. What's the best way to make references to chunks of code so I can both update them as Library items and decrease the amount of lines? Again, I'd like the main content copy to appear closer to the top of the document for search engine spiders.

       

      In other words, is there a way, for example, to reference say 30 lines of Nav Menu code in a couple of lines AND be able to edit it as a library item? Dreamweaver simply wraps Library items in reference tags and adds lines.

       

      Any ideas?

        • 1. Re: Library, Snippets, or Another Way to Make References to Chunks of Code?
          Nancy OShea Adobe Community Professional & MVP

          WOW!  You have a major misunderstanding of what library items and snippets are all about.  They are a shortcut for inserting code fragments into web pages from within DW.  But final code is final code.  Open your page in a web browser and View Source or Page Source to the see the final output.  Code is no shorter or compressed than if you had manually coded the site yourself.

           

          Collapsed code is another DW feature that allows you to collapse sections of code in Code View.  It does not, however, effect the final published code.  It's simply a viewing option.

           

          I'd like the main content copy to appear closer to the top of the document for search engine spiders.

           

          Put important content higher up in your HTML markup.

           

          Use a CSS layout that floats your #mainContent division around sidebars.  Do a Google search for CSS Holy Grail.

           

          FYI: Your layout isn't going to make or break your site if you have plenty of relevant, unique, keyword-rich content on your pages.  Use good semantic markup (h1, h2, h3, p... tags) and the search engines will treat you favorably.  If you don't, they won't.

           

          Finally, JavaScripted menus and image rollovers take up a lot of document space between your <head> tags.  To reduce code bloat, switch to CSS or Spry menus.

           

           

          Good luck,

           

          Nancy O.
          Alt-Web Design & Publishing
          Web | Graphics | Print | Media  Specialists
          www.alt-web.com/
          www.twitter.com/altweb
          www.alt-web.blogspot.com

          1 person found this helpful