Is this good code? Good practice advice needed...

Is this good code? Good practice advice needed...

am 08.11.2007 21:01:57 von SM

Hello,

I've created a gallery of photos in php. The model is very simple:
Album/subalbum/photos.
If the user clicks on an album, a bunch of subalbums appear. And if
the user selects one of the subalbum, a gallery of photos appear.

The gallery of photos appear right beneath the subalbum list item
selected by the user. I've tested everything and the result is prety
cool.

Now, because im trying to be compiant with HTML/XHTML, and mostly
because im trying to create good code, i was wondering if the piece of
code is OK.

Even though everything works ok, i was wondering for example if i can
insert a

between an
  • .
    Is it better to put an inside a
    • when im constructiing a
      list?


      This is a sample of the code. Notice the insertion of the gallery
      beneath the
    • selected by the user.
      ....



















      ......

      Is this good code?

      Thanks
      Marco

  • Re: Is this good code? Good practice advice needed...

    am 08.11.2007 21:28:14 von Adrienne Boswell

    On Nov 8, 12:01 pm, SM wrote:
    > Hello,
    >
    > I've created a gallery of photos in php. The model is very simple:
    > Album/subalbum/photos.
    > If the user clicks on an album, a bunch of subalbums appear. And if
    > the user selects one of the subalbum, a gallery of photos appear.
    >
    > The gallery of photos appear right beneath the subalbum list item
    > selected by the user. I've tested everything and the result is prety
    > cool.
    >
    > Now, because im trying to be compiant with HTML/XHTML, and mostly
    > because im trying to create good code, i was wondering if the piece of
    > code is OK.
    >
    > Even though everything works ok, i was wondering for example if i can
    > insert a

    between an
  • .
    > Is it better to put an
    inside a
    • when im constructiing a
      > list?
      >
      > This is a sample of the code. Notice the insertion of the gallery
      > beneath the
    • selected by the user.
      > ...
      >
      >

      >

        >

      • >

      • >

      • >

      • >

        >
        >
        >
        >
        >
        >

        >
        >

      • >

      • >

      >

      > .....
      >
      > Is this good code?
      >
      > Thanks
      > Marco

      A URL would be more helpful. But the answer your question, run the
      page through the validator and see what it comes up with. Hint: a UL
      element can only contain LI elements.

  • Re: Is this good code? Good practice advice needed...

    am 08.11.2007 22:08:31 von SM

    On Nov 8, 3:28 pm, Adrienne Boswell wrote:
    > On Nov 8, 12:01 pm, SM wrote:
    >
    >
    >
    > > Hello,
    >
    > > I've created a gallery of photos in php. The model is very simple:
    > > Album/subalbum/photos.
    > > If the user clicks on an album, a bunch of subalbums appear. And if
    > > the user selects one of the subalbum, a gallery of photos appear.
    >
    > > The gallery of photos appear right beneath the subalbum list item
    > > selected by the user. I've tested everything and the result is prety
    > > cool.
    >
    > > Now, because im trying to be compiant with HTML/XHTML, and mostly
    > > because im trying to create good code, i was wondering if the piece of
    > > code is OK.
    >
    > > Even though everything works ok, i was wondering for example if i can
    > > insert a

    between an
  • .
    > > Is it better to put an
    inside a
    • when im constructiing a
      > > list?
      >
      > > This is a sample of the code. Notice the insertion of the gallery
      > > beneath the
    • selected by the user.
      > > ...
      > >
      > >

      > >

        > >

      • > >

      • > >

      • > >

      • > >

        > >
        > >
        > >
        > >
        > >
        > >

        >
        > >

      • > >

      • > >

      > >

      > > .....
      >
      > > Is this good code?
      >
      > > Thanks
      > > Marco
      >
      > A URL would be more helpful. But the answer your question, run the
      > page through the validator and see what it comes up with. Hint: a UL
      > element can only contain LI elements.

      Thanks!
      I completely forgot about the W3C validator.
      I did the validation test and, indeed, i got an error on the

        element not having a
      • tag.
        I've added a
      • tag that wraps around the
        (weird as it may
        sound) and validates correctly!

        Thanks again dude!


        code change:
        > ...
        >
        >

        >

          >

        • >

        • >

        • >

        • >

        • >

          >
          >
          >
          >
          >
          >

          >

        • >

        • >

        • >

        >

  • Re: Is this good code? Good practice advice needed...

    am 08.11.2007 22:21:03 von Nik Coughlin

    SM wrote:
    >>


  • >>

  • >>

    >>
    >>
    >>
    >>
    >>
    >>

    >>

  • >>


  • Do you need that div at all?











  • And while you're at it you could be pedantic and say that the thumbnails are
    a list as well:











  • Re: Is this good code? Good practice advice needed...

    am 08.11.2007 23:09:43 von dorayme

    In article
    <1194546107.988576.42520@z24g2000prh.googlegroups.com>,
    SM wrote:

    > This is a sample of the code. Notice the insertion of the gallery
    > beneath the

  • selected by the user.
    > ...
    >
    >

    >

      >

    • >

    • >

    • >

    • >

      >
      >
      >
      >
      >
      >

      >
      >

    • >

    • >

    >

    > .....
    >
    > Is this good code?
    >


    Not really, you can't do this. This is better and you can
    probably improve further:

    http://tinyurl.com/27yrkx

    --
    dorayme

  • Re: Is this good code? Good practice advice needed...

    am 09.11.2007 02:10:13 von dorayme

    In article <47337daf$1@clear.net.nz>,
    "Nik Coughlin" wrote:

    >


  • >

  • >
    >
    >
    >
    >
    >

  • >

  • >

    This is not really correct because the idea is that the
    thumbnails are an expansion of the item Tribute. Your
    alternative, below, is correct but it is not pedantic.



    > And while you're at it you could be pedantic and say that the thumbnails are
    > a list as well:
    >
    >

  • >

  • >

      >

    • >

    • >

    • >

    • >

    • >

    >

  • >


  • --
    dorayme

    Re: Is this good code? Good practice advice needed...

    am 09.11.2007 03:32:35 von Adrienne Boswell

    Gazing into my crystal ball I observed SM
    writing in news:1194556111.076808.276700@e9g2000prf.googlegroups.com:

    >
    > Thanks again dude!
    >
    >

    That would be Dudette!

    --
    Adrienne Boswell at Home
    Arbpen Web Site Design Services
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share

    Re: Is this good code? Good practice advice needed...

    am 09.11.2007 08:59:47 von Els

    dorayme wrote:

    > In article <47337daf$1@clear.net.nz>,
    > "Nik Coughlin" wrote:
    >
    [snip]
    > This is not really correct because the idea is that the
    > thumbnails are an expansion of the item Tribute. Your
    > alternative, below, is correct but it is not pedantic.

    [snip example where the nested ul is inside the list element
    *following* the Tribute list element]

    I'll be pedantic then ;-), and say it is not correct. If the
    thumbnails are indeed an expansion of the item Tribute, the list would
    look like this:













  • --
    Els http://locusmeus.com/

    Re: Is this good code? Good practice advice needed...

    am 09.11.2007 09:38:25 von dorayme

    In article <1qr3hbl0xduir$.dew6rcfkfsqr.dlg@40tude.net>,
    Els wrote:

    > dorayme wrote:
    >
    > > In article <47337daf$1@clear.net.nz>,
    > > "Nik Coughlin" wrote:
    > >
    > [snip]
    > > This is not really correct because the idea is that the
    > > thumbnails are an expansion of the item Tribute. Your
    > > alternative, below, is correct but it is not pedantic.
    >
    > [snip example where the nested ul is inside the list element
    > *following* the Tribute list element]
    >
    > I'll be pedantic then ;-), and say it is not correct. If the
    > thumbnails are indeed an expansion of the item Tribute, the list would
    > look like this:
    >
    >


  • >

      >

    • >

    • >

    • >

    • >

    • >

    >

  • >


  • That will teach me to be so soft-hearted and trusting! I had just
    posted at the time:

    http://tinyurl.com/27yrkx

    what I thought was a *more* correct plan than the OP

    and assumed without looking closely that Nick was following this
    general idea.

    --
    dorayme

    Re: Is this good code? Good practice advice needed...

    am 12.11.2007 04:39:11 von SM

    On Nov 9, 3:38 am, dorayme wrote:
    > In article <1qr3hbl0xduir$.dew6rcfkfsqr....@40tude.net>,
    >
    >
    >
    > Els wrote:
    > > dorayme wrote:
    >
    > > > In article <47337da...@clear.net.nz>,
    > > > "Nik Coughlin" wrote:
    >
    > > [snip]
    > > > This is not really correct because the idea is that the
    > > > thumbnails are an expansion of the item Tribute. Your
    > > > alternative, below, is correct but it is not pedantic.
    >
    > > [snip example where the nested ul is inside the list element
    > > *following* the Tribute list element]
    >
    > > I'll be pedantic then ;-), and say it is not correct. If the
    > > thumbnails are indeed an expansion of the item Tribute, the list would
    > > look like this:
    >
    > >


  • > >

      > >

    • > >

    • > >

    • > >

    • > >

    • > >

    > >

  • > >

  • >
    > That will teach me to be so soft-hearted and trusting! I had just
    > posted at the time:
    >
    > http://tinyurl.com/27yrkx
    >
    > what I thought was a *more* correct plan than the OP
    >
    > and assumed without looking closely that Nick was following this
    > general idea.
    >
    > --
    > dorayme

    Thank girls and guys!
    Everything makes sense now....