Results 1 to 3 of 3
Jul 28, 2006, 18:42 #1
Fluid Layout with Images and a CMS
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?
Jul 28, 2006, 20:18 #2
- Join Date
- Jun 2004
- "Then I figure the most good good guy will win."
- 0 Post(s)
- 0 Thread(s)
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.
Jul 29, 2006, 04:30 #3Originally Posted by all4nerds