Was this page helpful?

Drupal - CCK

    Table of contents

    Upgrading

    ToDo:

    When upgrading Drupal core, there needs to be adjusted file includes/common.inc

    Add the following rows into the file (just after PHP):

    /** myincludes **/
    
    @include_once('myincludes/related_articles.php');
    @include_once('myincludes/cookie_checker.php');
    @include_once('myincludes/Mobile_Detect.php');
    @include_once('myincludes/banner_changer.php');

    This should be preferably changed to follow some Drupal guidelines. We'll need Drupal developer to do this.

    The files above are attached.

    Bugfix

    When some pages doesn't load and error message is something about l() function getting wrong third argument (like it should be an array and it ain't). It's probably because the array with links from theme stores some extra items theme.inc doesn't know how to treat. However you can just ignore them. So find theme_links() function in theme.inc and add line of code displayed bellow right on the start of them main link cycle.

    if (!is_integer($key)) continue;
    

    So tthe result should be something like this:

    foreach ($links as $key => $link) {
          if (!is_integer($key)) continue;
          $class = array($key);
    

    Development

    Best book for this matter: "Drupal Building Blocks"

    See link: http://www.amazon.com/Drupals-Building-Blocks-Quickly-Panels/dp/0321591313/ref=sr_1_1?s=books&ie=UTF8&qid=1307965334&sr=1-1

     

    CCK or Content Construction Kit is the key to customizing your drupal content, creating your own content type along with it's features. 

     

    Required modules: 

    In order to access the full power of customization in Drupal, you will require the following modules: 

    CCK: http://drupal.org/project/cck

    Views: http://drupal.org/project/views

    Panels: http://drupal.org/project/panels

     

    Other useful modules:

    Fiefield (useful for attaching files to a node, i.e. an image attached to a blog post): http://drupal.org/project/filefield

    ImageField: http://drupal.org/project/imagefield

     

    Nodes: 

    The atom is the fundamental building block of all matter in the universe; the node is the fundamental building block of all Drupal sites on the Internet.
     
    Fields:
    Fields are the protons, neutrons, and electrons of the Drupal atom. You can’t build a node without fields, and every content type is made up of fields.
     
     
    Creating new content type: 
    Go to Administer >> Content Management >> Content types. 
     
    Example: 
    You’ve got a Web site where you’d like to keep track of your homebrew recipes.
    You need to create a content type to contain recipe information.
    1. Click the Add content type link.
    2. Give the new content type a Name, Type, and Description.
              Name: Beer recipe
                        Type: beer_recipe
                        Description: Homebrew recipes—relax, don’t worry!
    3. Save the content type.
              4. Open the submission guidelines fieldset and enter “About this recipe” in the
                  submission guidelines.
              5. Open the Workflow settings fieldset and check the boxes labeled “Published” and
                  “Promoted to front page” as well as the radio button under the heading
                  “Attachments” labeled “Enabled.”
              6. Save the content type.
     
    When you go back to the Content Type List page, your new content type will be added to the listing of available nodes to create. Clicking the Edit links will take you back to the content type creation page with the values you entered previously. You can also add a new homebrew recipe for your Web site from this page.
     
     
    Creating a Field for an Existing Content Type:
    Let's say you want to create an additional field for "Story", a field called "Originally written on" that contains the date on which the story was originally written (not posted). 
    1. Navigate to Administer >> Content Management >> Content types >> Story >>
        Manage fields.
    2. Scroll to the end of the page. Under Add >> New Field, enter these values in the
                  field data boxes:
                 Label: Originally written on
                           Field: name written_date
                           Type of data to store: Text
                           Widget: Text field
    3. Save the field.
    4. The settings page opens. Check the Required box, and set the value to 1.
    5. Save the field.
     
     
    Was this page helpful?
    Tag page (Edit tags)
    • No tags
    Page statistics
    3257 view(s), 7 edit(s), and 6018 character(s)

    Comments

    You must login to post a comment.

    Attach file

    Attachments

    FileSizeDateAttached by 
     banner_changer.php
    No description
    1863 bytes22:22, 22 Dec 2012jansafkaActions
     cookie_checker.php
    No description
    839 bytes22:22, 22 Dec 2012jansafkaActions
     Mobile_Detect.php
    No description
    2.56 kB22:22, 22 Dec 2012jansafkaActions
     related_articles.php
    No description
    1743 bytes22:22, 22 Dec 2012jansafkaActions