7 Replies Latest reply on Aug 2, 2016 9:07 AM by pziecina

    Floated Panels Extensions - dynamically adding content

    bg_sd Level 1

      I'm working on extending Dreamweaver and want to create a new floated panels. I am able to create it...

       

      But, I'm encountering a (little) problem. Is it possible to add content dynamically ?

       

      For example, let say I have a HTML page containing a table with a variable number of columns. When the user select the table node, I would like my extended floated panel to automatically add the column names (base on the thead>tr>th data) as new <p>COLUMN NAME</p> .

       

      I don't need (yet) the way to get the columns name, ... I just need to know if it's possible to add dynamic contents in a Floated Panel and if it's possible, how ?

       

       

      Thanks for your help!

        • 1. Re: Floated Panels Extensions - dynamically adding content
          Nancy OShea Adobe Community Professional & MVP

          You'll need to query your database and pull those records into the layout.  Are you using PHP and MySQL?

          • 2. Re: Floated Panels Extensions - dynamically adding content
            bg_sd Level 1

            I know how to create the table dynamically for a webpage. That's not the problem   (and I'm using MySQL and PHP).

             

            Let me explain perhaps a little better:

            I created a floated panel for Dreamewaver, using this:

            Adobe Dreamweaver CS5 & CS5.5 * A simple floating panel example

             

            But the problem here is I can't fill dynamically the content. It seems that you are stuck to use only what is loaded between the body tags of the extension.

            Is there a way to fill the extension panel dynamically ?

            • 3. Re: Floated Panels Extensions - dynamically adding content
              Nancy OShea Adobe Community Professional & MVP

              Absolutely positioned elements require set height and width values which negates any potential for dynamically expanding content.  I wouldn't use that extension.

               

               

              Nancy O.

              • 4. Re: Floated Panels Extensions - dynamically adding content
                pziecina Adobe Community Professional

                Hi

                 

                You do not say which version of Dw you are actually using, as the documentation for creating extensions for Dw is for CS5/5.5 which is not the latest version. Anything after CS6 may work differently for what you are trying to do, and there is no real documentation available.

                 

                You could 'pull' the info from a database prior to Dw CC, but I would not recommend doing so for Dw CC or later as these did not have the Server behaviours installed as standard.

                 

                This unfortunately means that as you have found, you only have what is currently loaded into Dw. What you have to do is query the current document code and extract the info from that. From what I remember there are functions for getting, increasing and deleting table 'items', which are dom functions.

                 

                the ones I remember are -

                dom.canInsertTableColumns()

                dom.canIncreaseColspan()

                dom.getTableExtent()

                 

                If you look up these in the 'extending Dw' documentation that you link to, it should show you the related functions, arguments, and return values.

                 

                Maybe one of the extension developers will reply to your post and be able to provide you with more info.

                1 person found this helpful
                • 5. Re: Floated Panels Extensions - dynamically adding content
                  bg_sd Level 1

                  I'm using Dreamweaver 2015.3 (and also the 2017 Beta version).

                   

                  So far from what I found, the table insertRow, insertCell, ... aren't available in the extension's DOM. Again, to be clear, I don't ask to do it for the main HTML/PHP page. This is something I know how to do.

                   

                  The main problem is in the extension API. It looks like Dreamweaver is using a (very) old version of javascript (not possible for example to use: for( var i in object){ .... } - I read somewhere Netscape 4.0  - ( ! but I may be wrong ) ) and also that the extension's DOM isn't complete.

                   

                  After reading some information here and there, I'm thinking that 'Floated Panels' are defined to contain 'static' data (like buttons to add things), but not to display a various amount of data, nor can it be styled.

                  • 6. Re: Floated Panels Extensions - dynamically adding content
                    bg_sd Level 1

                    Just found the workaround... Instead of adding content, you can use object.innerHTML to set the html code. You can't add, but can completely rewrite the data in the extension DOM.

                     

                    Thanks all for your help

                    • 7. Re: Floated Panels Extensions - dynamically adding content
                      pziecina Adobe Community Professional

                      Hi

                       

                      Glad you found a solution.

                       

                      It may be worth checking what you are doing with the Brackets api and extension creation documentation -

                      https://github.com/adobe/brackets/wiki/How-to-Write-Extensions

                      http://brackets.io/docs/current/modules/brackets.html

                       

                      The reason I mention this, is because it has been said in the Beta pre-release, that it is planned to include the ability to install extensions written for Brackets.

                      More than that I have no info on how this will be done, or on future compatibility for 'older' extensions. You could post a question in the Beta forum, and hopefully one of the Dw staff members will be able to tell you more.