SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile help needed with detail page

    Hi everybody
    I'm have to make three .cfm pages for a school project (see:http://www.sitepoint.com/forums/showthread.php?t=443886) The search and results pages are working very good thanks to some very helpful members here on the forum. What is left is a detail page.

    I found the following page on the internet: http://www.macanthonyrealty.com/deve...lopmentID=1006 and I would like to make a similar detail page for my project (I mean three or four thumbnails which onClick make the main picture change) allong with the general information about a certain book. I have untill Saturday to finish and really don't know where to start?


    In total I have 5 tables in the database:
    Table: books Fields: (bookID, bookName, cover, descrption, keywords, writerID, genreID)
    Table: writers Fields: (writerID, writerName)
    Table: genres Fields: (genreID, genreName)
    Table: photos Fields: (photoID, bookID, photoName, description, thumbnail)
    Table: description Fields: (descriptionID, bookID, comment, description)


    I wonder if my tables are suitable for what I want, the way they are right now, or that I should make any changes, like itegrating the fields fromphotos into the table books?

    Where should I start or is there any kind of tutorial about a similar subject? I found this tutorial http://tutorial44.easycfm.com/ but as you can see it is a system where the large picture is displayed in a seperate window. Any suggestion or guidens in the right direction is more then welcom

    Thank you in advance
    Last edited by newbiedon; Dec 12, 2006 at 00:44.

  2. #2
    Take The Blue Pill neilmerton's Avatar
    Join Date
    Jul 2004
    Location
    Leicester, UK
    Posts
    871
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the swapping of images can be achieved with a bit unobtrusive javascript - see link to get an idea of what can be accomplished:
    http://www.afhill.com/blog/2006/06/2...ve-javascript/

  3. #3
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by neilmerton View Post
    the swapping of images can be achieved with a bit unobtrusive javascript - see link to get an idea of what can be accomplished:
    http://www.afhill.com/blog/2006/06/2...ve-javascript/
    Thanks for the link Neil

    But how do I integrate this in my project as it is so far? Sorry for maybe a stupid question, but I'm reasonably new to Coldfusion and with a combination of CF and Jafascript makes it even more complicated.

    Thank you in advance

  4. #4
    Take The Blue Pill neilmerton's Avatar
    Join Date
    Jul 2004
    Location
    Leicester, UK
    Posts
    871
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the way to go around this is to first figure out the exact data is that you'd like to display (Book Title, a description, maybe a price along with some photos).

    once you've done that write the SQL and dump the query to check it's working.

    then start work on the actual page. visualise how it should be laid out and create the page (normally i create a static page first and once i'm happy with it change it to be dynamic).

    with that JavaScript simply copy everything from the 'function prepareGallery() {' line and save it as a separate .js file. Call this file somewhere between the 'head' tags. then use the list ('ul' tags) and image where you'd like to have them displayed.

    i hope this helps.

  5. #5
    Take The Blue Pill neilmerton's Avatar
    Join Date
    Jul 2004
    Location
    Leicester, UK
    Posts
    871
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah - just tested out that script and there's a bit missing - here's the full javascript needed:

    Code:
    function showPic(whichpic)
    {
        if (!document.getElementById) return true;
        var source = whichpic.getAttribute("href");
        var placeholder = document.getElementById("placeholder");
        placeholder.setAttribute("src",source);
        return false;
    }
    function prepareGallery()
    {
        if (!document.getElementsByTagName) return false;
        if (!document.getElementById) return false;
        if (!document.getElementById("imagegallery")) return false;
        var gallery = document.getElementById("imagegallery");
        var links = gallery.getElementsByTagName("a");
        for ( var i=0; i < links.length; i++)
        {
            links[i].onclick = function()
            {
                return showPic(this);
            }
        }
    }
    window.onload=prepareGallery

  6. #6
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by neilmerton View Post
    ah - just tested out that script and there's a bit missing - here's the full javascript needed:
    Thank you so much Neil It took me some time but I have it working now cheers

  7. #7
    Take The Blue Pill neilmerton's Avatar
    Join Date
    Jul 2004
    Location
    Leicester, UK
    Posts
    871
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no probs. glad to be of help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •