SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist FCC's Avatar
    Join Date
    May 2006
    Posts
    417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fluid Layout with Images and a CMS

    Hello all,

    Ok, I got a dilemna here. I've designed a CMS which works for about 20 websites. I want to allow the users to also change images. Now currently the images I have are all fluid images.

    What I mean by this is their widths are percentages and they fit perfectly into the template. So if I had like a 500px container and 200px width image, I would just set the width to be 40%

    Now the problem occurs if the users now upload images which are not the size I currently have.....well everything goes haywire in a sense.

    I don't want to set image widths because I want the site to be fluid, but I also don't want to have to specific the EXACT image width of every image on every template (because I'm almost certain some users will not listen to the instructions).

    So the question here is:

    Is there a way around this? Or is this a catch 22?

  2. #2
    .* draziW tnioPetiS *. bronze trophy
    Join Date
    Jun 2004
    Location
    "Then I figure the most good good guy will win."
    Posts
    1,666
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm,

    Well, do you not want to use PHP to calculate image dimensions?

    Maybe setup a function to check image size on upload. If they funked-up the process, throw them an error message "try again".

    Or, use PHP to resize the images once uploaded - make them fit.

    Or, (the less helpful answer) change your layout/design to accomodate these types of problems?

    Sounds like an odd situation really... So, the user-defined images have to be a specific width/height, or does the user have some play room?

    If each image has to be a specific width/height, it seems like you could hard-code width/height into the image tag (and/or use PHP to calculate width/height) and if the user messed-up, at least the layout would still be intact. I would opt for funky-looking images over a broken layout.

    Hehe, hth?
    Gl,
    Cheers,
    Micky

  3. #3
    SitePoint Evangelist FCC's Avatar
    Join Date
    May 2006
    Posts
    417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by all4nerds
    Hello

    container 100% ?

    image container 40%

    image width 100%
    My God you are a genius I tell you.


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
  •