Hi.
Is there any way to edit the source of the posting page of a specific content type?

I need a section in my site, where users should be able to upload their files and other users should be able to send comment on them... and download the files... .

I've created a new content type, and what i need now, is 2 things.

  • first. I want to know if there is a possiblity to modify the source of posting page of a specific content type?
    [I want to bring the attachment section out of the collapsible box and also put it on the top of everything. See screenshot]
  • second. I need to extend the limitation of file size from 1MB to something else! where can i do this?

Comments

aria_radmand’s picture

guys?
this means nobody knows anything about my problem??

WorldFallz’s picture

Please don't take this the wrong way, but you're probably not getting an answer because the questions you're asking are easily answered yourself with a little reading.

That said, regarding your first question, yes you can alter just about any source in drupal you need to. See the http://drupal.org/theme-guide handkbook pages. Since you want to alter the source of content types, you're probably going to want to edit the node.tpl.php file and/or create node-{content-type}.tpl.php files for specific content types, and perhaps the template.php file of your chosen theme.

Regarding question 2, see the Increase upload size in your php.ini handbook page.

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz

aria_radmand’s picture

Thank you for your solution, but this is not what i wanted to know. Maybe this is my fault that I can not explain my problem in a good way. Anyway, I already knew what you said, when i was creating this topic and my questions still remain unsolved.

Maybe it'd be better if I describe more eloquently:

  • About my first problem. I created a content type, named (filezz) and i want to change its Creating [node/add] and Editing [node/edit] page as you can see in the screenshot.

    I followed this document step by step. But still I was not able to change the template of the goddamn creating/editing page.

    I created a file named (filezz_edit.tpl.php) in my theme folder [/themes/tendu/filezz_edit.tpl.php] with this content:

    print("test!");
    

    and I also added these lines at the end of (template.php) as described here in third step:

    // Add Form Start (jghyde)
    if ((arg(0) == 'node') && (arg(1) == 'add') && (arg(2) == 'content_filezz')){
      function phptemplate_node_form($form) {
        return _phptemplate_callback('filezz_edit', array('user' => $user, 'form' => $form));
      }
    }
    // Add Form End
    
    // Edit Form Start (Dublin Drupaller)
    if ((arg(0) == 'node') && (arg(2) == 'edit')){
      $node = node_load(array('nid' => arg(1)));
      function phptemplate_node_form($form) {
        return _phptemplate_callback('filezz_edit', array('user' => $user, 'form' => $form));
      }
    }
    // Edit Form End
    

    But nothing changed.

    • I also created a file named (node-filezz.tpl.php) in my theme folder [/themes/tendu/node-filezz.tpl.php] with this content (as you said):

      print("test!");
      

      I did not see any changes again.

  • About my second problem. I knew that I can change the upload limit of php.ini! but it seems that the upload limit of drupal is something else. because my php.ini upload limit is set to 2MB by default, but the drupal limitation for upload attachments is 1MB. and of course it certainly is changeable; but I just don't know where.
sudeepg’s picture

Are you on Drupal 5 ??? This would work for Drupal 5, but not 6.

For upload, assuming Drupal 5 check out: admin/settings/uploads for normal file uploads and admin/user/settings for user picture size uploads.

Sudeep Goyal,
Ebizon NetInfo Pvt. Ltd.
Delhi, India
http://ebizontek.com
Ph: +91120 4546843
Email: info@ebizontek.com
skype id : sudeep.goyal

WorldFallz’s picture

Ok, now I see what you're asking ;-)

For question one, theming the node.tpl.php files does not change the edit form (as you've found out). I'm still no expert at it, but this video helped me immensely: Fine-tuning the UI by Theming Forms In Drupal 6.0. And the other poster is quite correct-- theming changed quite a lot from d5 to d6 which is probably why the handbook page isn't working for you. Watch the video and you should be able to do what you want.

As for the second question, the drupal piece of that setting is at: admin/settings/uploads (which is mentioned on that handbook page in the very first paragraph).

===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz