New tutorials and articles

I have just added to my site a tutorial on converting a Spry Menu Bar into a server-side include. I have also been busy adding a bunch of brief articles to the Dreamweaver Cookbook on the Adobe site.

I answer a lot of questions in the Dreamweaver forums, and realized that a lot of the solutions I was coming up with for people weren’t easy to find after a couple of days. So, rather than letting them disappear into cyberoblivion, I decided to add any of general interest to the cookbook when I had a few spare moments. The Dreamweaver Cookbook is intended for code samples, and doesn’t have the capability of including screenshots, so I’ll continue posting longer tutorials on my own site. But I hope you’ll find my contributions to the cookbook useful.

Here are direct links to some of the articles I have added to the Dreamweaver Cookbook:

The Dreamweaver Cookbook is open to anyone to either request recipes or contribute recipes of their own. It could turn into a very useful resource if people start using it regularly. Check it out!

This entry was posted in AJAX/JavaScript, Dreamweaver, MySQL, PHP. Bookmark the permalink.

15 Responses to New tutorials and articles

  1. Mollie Twidale says:

    I used your tutorial for changing the default tab for a Spry tabbed panel. Yes, it works, but the tabbed panel no longer works like a tabbed panel – it’s a single long page, and the tabs are not functional anymore. I followed your instructions, from downloading Spry 1.6. Is this the behavior you intended?

  2. David Powers says:

    No, it’s not what I intended. If the tabs are no longer functional, it sounds as though you have made a mistake somewhere. Without seeing the page you have built, it’s impossible to say. Of course, it’s possible there’s a mistake in my tutorial, but you don’t say exactly which tutorial you were using. So you don’t give me much to go on to help you.

  3. Rose says:

    Dear David,

    I’ve been following your tutorial on linking to another page and setting the default Accordion panel. I’m not able to get this to work. First of all, the javascript code for the accordion panel

    var Accordion1 = new Spry.Widget.Accordion(“Accordion1″, {defaultPanel: params.panel ? params.panel: 0, useFixedPanelHeights: false});

    always leave all my panels in the open state. Furthermore, I’m not able to get the panels param to pass through? I’m not sure since all the panel are already open. Here is the link I’m using:

    <a id="content1" href="?recordID=&?panel=1#Accordion1″>

    I would appreciate some input thanks.

    Rose

  4. David Powers says:

    Rose, It’s impossible to judge without seeing the actual pages, but if all the panels are open, it sounds as though there’s something wrong with the code on the page that contains the accordion. You need to get that sorted first.

    Secondly, your link doesn’t make sense. It has got two question marks and a variable with no value. The href attribute should look something like this: "somepage.html?panel=1#Accordion1".

  5. rose says:

    Dear David,
    Here is the code for the second panel that I’m experimenting with.

    Doctor Who

    <a id="content1" href="?recordID=&?panel=1#Accordion1″>

    And here is the javascript code for the panel animation

    I hope the above information is more helpful.

    What I am doing is passing a php query via an URL to the detail section on the same page. This does work. I’m just trying to get the accordion panel that the user us currently in to stay open. My understanding is any php request cause a page refresh and that is why the panel always defaults to panel=0.

    Thanks a bunch
    Rose

  6. Rose says:

    Update,

    I finally got it all to work!
    Apparently I didn’t have the code right in the header for the JavaUtils. Once I got that fixed then my panels opened and closed just fine.

    Next, I added the tab=n in front of the panel=n#Accordion1 in the URL.

    Just to let you know, your tutorial is a bit confusing at that point. I thought you were talking about tabbed panels AND accordion panels. Once I put that in, everything works great.

  7. Kat Williams says:

    David,

    I followed your instruction for customizing the horizontal menu bar. Fantastic! Clear and easy to follow. Thank you.

    Kat

  8. Wow, it’s a lot easier than I thought it would be. Thanks

  9. Kathy says:

    I am designing a web page and I need a condolences form, much like a blog, where the condolences are published on the website. Any suggestions on putting this form on a dreamweaver page.

  10. David Powers says:

    You could use the Building Your First Dynamic Website tutorial in the Adobe Developer Connection as a starting point. However, the big problem with online forms that display user input is spam. That tutorial doesn’t teach how to prevent spam. You could use a CAPTCHA, or get the form to send you an email before you approve comments. That’s why blogs are so useful, because they handle all that side of things for you.

  11. Leolux says:

    The “Upload image to website” recipe in Adobe’s cookbook is great. It works like a charm compared to other tutorials with the same topic.
    If, by chance, you’ll find time to write a recipe about how to insert the image’s name and path into a database you’ll make some users happy.

    Leolux

  12. David Powers says:

    Glad you found it useful. I’m up to my eyeballs writing a new book, so I won’t have time to add anything else to the Dreamweaver Cookbook for some time. Sorry.

  13. Chris R says:

    David,

    Sorry to take time from your new book. I suspect it must be the one I pre-ordered at Amazon on Dreamweaver CS5. I never look forward to the end of summer, but this year I am looking forward to August 20th.

    I’m building a page based on the “Upload image to website” recipe. Everything works great unless I try to add a duplicate image. Instead of getting the expected “A file of the same name already exists”, the page throws the error: “Undefined variable: success in C:\vhost\filepath\upload.php on line 29″.

    Line 29 is the first line of the following section:


    if ($success) {
    $result = "$file uploaded successfully.";
    } else {
    $result = "Error uploading $file. Please try again.";
    }

    Success is first mentioned on line 23 and the entire section is:

    $success =
    move_uploaded_file($_FILES['image']['tmp_name'], UPLOAD_DIR .
    $file);
    } else {
    $result = 'A file of the same name already exists.';
    }
    if ($success) {
    $result = "$file uploaded successfully.";
    } else {
    $result = "Error uploading $file. Please try again.";
    }

    So far I’ve just copy and pasted the code onto a standard blank Dreamweaver PHP page and made the changes needed for my upload directory and filesize. I haven’t added any other HTML or CSS yet. Is there something else I need to change or is there a bug in the code?

    Thanks,
    Chris

  14. stephanie says:

    http://cookbooks.adobe.com/post_Create_search_query_with_optional_fields-16245.html

    Hello Mr. Powers,

    is there any place/book where you have the above information on searching a database with optional html input without using dreamweaver? Only php, mysql, and html? Thanks

    Stephanie

  15. David Powers says:

    Stephanie, The Dreamweaver-specific part of that script is the use of GetSQLValueString(), which checks that data type (“int”, “text”, etc) and passes the data to mysql_real_escape_string(). Sorry, but I don’t have time at the moment to refactor the script. If you have a reasonable understanding of PHP, it shouldn’t be too difficult to adapt.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>