Can any one help me?
I have been many time looking around to solve this problem.
Now I know, how to make a new content type and how to theme its output.
It was simple. just make a 'node--content-type-name.tpl.php' file in my template folder.
Now I want to theme input form.
when I find its way, just said, Make a new module or put some code in template.php
but I tried thousand of time but I didn't make any result.
I think I didn't understand it very well. It too difficulty than just make a tpl.php file.
so, My questions are.
1. Is there any way to make a input theme file like, node--content--edit.tpl.php?
( I found, in page case, make a page--node--add--content-type.tpl.php)
2. Do I have to make a custom module? if I want to theme input in content-type?
3. Some people said, put theme() function in template.php in site/all/theme/bartik folder.
I put a code below but It didn't work. did I miss anything?
1. content-type name : mycontent
function mycontent_theme() {
return array(
'mycontent_node_form' => array(
'agruments' => array('form' => NULL),
'template' => 'mycontent-node-form',
),
);
}then I made mycontent-node-form.tpl.php file in the site/all/theme/bartik/template folder
and I put just random text in it. (adsfasdfkajsdhfkash)
but nothing happened.
actually I just want to make a agreement box in my content-type (INPUT)
but I have spent to much time. Can anyone help me?
Comments
You are not really talking
You are not really talking about theming, your are talking about adding a field.
While you could do it with code, you could add a integer field with check box widget and either use the field description/help for the agreement text or use a Markup field.
Then use Field Validation to make sure it is checked.
If you are looking to add
If you are looking to add something to a form that the user interacts with (e.g. a checkbox, text, etc) then, as nevets said, you are talking about adding a field. If you used the base drupal install (as opposed to the minimal install) then when you go to structure->content types -> your content type -> manage fields you should see options to add new fields.
If you just want text (no checkbox) then the markup module is just the ticket. It'll let you add text or html elements to a page without a form control.
In the case of an agreement- where you need to require acknowledgement, e.g. a checkbox with 'I agree to the terms yada yada' that they have to check before posting, then use a boolean field and require it. Since the label length is limited, I'll usually put a 'I agree ...' type statement as the label, then put details in the field description, e.g. 'By checking the box above, you agree that ....'
If you are looking theme a node edit form as in change the styles, you can do that with CSS.
If you are looking to rearrange the placement of the fields, look into the Display Suite module
I'm unique, just like everybody else.
If I helped, please pay it forward, backward or sidelong.