David Slack - Web developer

CCK for images

Now we have the modules all installed and setup we'll go and make it so the user can upload an image on the page. You will have to do tis for each content type, but we will only do page and story for now

  1. Go to admin
  2. On the left click Content Types
  3. Click 'Manage Fields' to the right of 'Page'

Group

We'll add a group for our images so under New Group type Images in the box for Label and 'images' for the box for Group name now hit the Save button. Now to configure the group

  1. Click 'Configure' to the right of Images
  2. Click the 'collapsed' radio button
  3. Hit the Save button

Fields

Set up the main image field first

  1. Under New field type 'Main image' in the box under Label
  2. Type 'main_image' in the box under Field name
  3. Select File as the type
  4. Image as Form element
  5. Hit the Save button
  6. In the help text type "Click the Choose file button and find your image from your computer. Click select when you have found it and click the Upload button to upload the image to the server. This will create all the images in the correct sizes and formats. You can only choose 1 image here"
  7. Under 'Imagecrop' tick 'Enable JavaScript crop' and 'main'
  8. Tick the Required box.
  9. Hit the Save field settings box

Now the sub images

  1. Under New field type 'Sub image' in the box under Label
  2. Type 'sub_image' in the box under Field name
  3. Select File as the type
  4. Image as Form element
  5. Hit the Save button
  6. In the help text type "Click the Choose file button and find your image from your computer. Click select when you have found it and click the Upload button to upload the image to the server. This will create all the images in the correct sizes and formats. You can only use as many images as you need"
  7. under Number of values: select unlimited
  8. Hit the Save field settings box
NB. If anything here is not working there could be a problem with the javascript. Your best bet is to re-upload everything and refresh the page. If not, comment below with your problem and I'll see if I can help.

Now we need to drag the images into the image group. Select the little cross to the left of Main image and drag right so it will kind of tab to the right. Do the same for Sub image. Now move Images up under Title in the same way and it will drag the Main and Sub images with it.

Hit the Save button

Latest content

There are lots of developers out there with varying degrees of experience and expertise, some mid level, some junior and some senior. Some...
First thoughts are Symfony is ace!Only been using Symfony for 1 project but the amount of coding it has saved has been worth the time spent...
The Lost and Found website was built by myself (David Slack) and designed by Arm & Eye.The site was created to promote a bar and...

Social networks

Contact me here or catch me on one of
the social networks below


What I'm listening to

My blog

Wednesday, 2 August, 2017 - 06:56
There are lots of developers out there with varying degrees of experience and expertise, some mid level, some junior and some senior. Some developers...
Tuesday, 5 March, 2013 - 09:49
First thoughts are Symfony is ace!Only been using Symfony for 1 project but the amount of coding it has saved has been worth the time spent learning...
Monday, 3 December, 2012 - 10:07
As a web developer and web designer I need to take into account everything on a site from SEO, marketing, usability across devices, the look and feel...

Try this on your mobile

Use your QR reader to read this

You should be able to use this right from the screen

Latest tweets

Calendar

M T W T F S S
1
 
2
 
3
 
4
 
5
 
6
 
7
 
8
 
9
 
10
 
11
 
12
 
13
 
14
 
15
 
16
 
17
 
18
 
19
 
20
 
21
 
22
 
23
 
24
 
25
 
26
 
27
 
28
 
29
 
30
 
 
 
 
 
 

You are here

Back to top

Copyright David Slack - Web developer