Extra text input in image widget -- Drupal 7 - drupal

I have a content type that contains an image field and uses image_image widget. When editing the node I'd like to add an extra text input for each image. This text is not part of the node, I'd use it to generate a translation. I know how to do tweak other parts of the form, but here I'm lost between hook_form_alter() and hook_field_widget_form_alter(). How does one do this?
For now, I use hook_form_alter and an after_build function to twist the image's alt field into what I need to see in the node edit form. Then I move the submitted value to where I want it and copy the image's title field value into its alt field value. I don't mind them being the same. But I'm sad.

You can use Field collection to bundle your image field with an extra text field that goes with it.

Related

how to put bullet point in the form access?

I have to design dataentry form in access 2013. user wants to have this possibilty that entering data in a feild and this feild automatically put bullet.
Is there any way I can set the field so that it defaults to bullet point?
I searched about it and I found : I should change datatype of this feild to long text in the TABLE and I changed text format to rich text in the TABLE and FORM.
then I should change default value of text box to
"<ul></li>"
in the FORM.
if I earse content of field then I loose this formatting ,I want to have just bullet format in this field not normal text , is this any way to force this field to bullet?
Insert a label at the left end of the line, type the letter l (lowercase el) as the caption, change to Wingdings font.

Sketchup - Is it possible to display the name of a Component dynamically in a Text tag?

Sketchup - Is it possible to display the name of a Component dynamically in a Text tag?
I want the Text to change if I rename the Component, the way dimensions change when you change its size.
You could use an observer to detect when the name change and then update the Text object. I think DefinitionsObserver with the onComponentPropertiesChanged event should work for that.
You need to find a way to keep track of which text element to update though.

How do I add a line of text to the instructions which are displayed on the node creation form for a custom content type?

In a node creation form, which is a custom content type, I want to add a text, not a text input field, but just a text line, as a remark or an NB, I search for long time in vain.
How can I do that?
Are you using the FieldGroup (http://drupal.org/project/field_group) module? If so, when creating a field-group for a content type's fields, select Vertical Tab as the type of fieldgroup and once you've placed the fields you want to include 'under' that group, save the page. You will then see a gear icon listed under the Operations menu within the row for your newly created field-group. Clicking on this gear icon will give you some additional options, including a Description area where you can write in instructions or whatever you like that will display on the node creation page within that particular tab and at the top of all the fields you have in that tab.
You should be able to add text using the markup form element.
Description: Generate generic markup for display inside forms.
Example from the documentation:
$form['contact_information'] = array('#markup' => variable_get('contact_form_information',
t('You can leave us a message using the contact form below.')),
);
This will work to give you overall instructions for the node creation form:
Create a new block.
Don't give the block a title.
Set block body to whatever you want the instructions for the node form to be.
Under the "Pages" option of the block creation set "Only the listed pages". Then add "node/add/[custom-content-type]" for whatever type of content it is.
Drag the new block to the top of your content section of your active theme.

optional CCK field automatically replacing another field in a View

I have a content type with 2 CCK text area fields.
The first field is always filled.
The second fields is optional.
Now: I have 2 Views.
In the first View the first field is always displayed.
In the second View the first 2 lines of the first field are displayed. However if the second field is filled, the first field should be ignored.
How can I make this. I need an option in the content type specifying if I should use the second field rather than the first one ? (For the second view)
I hope it is clear. Thanks
Create a template for the view and use if and else statements to only show what you want to be shown.

Drupal : How to add javascript function on click event of a cck check box?

I have added two fields one is check box and another one is text box to a content type and now i want to toggle the text box on clicking check box .Can any one help in doing so.
I just figured out the answer, we need to add in a conditional field setting (feature build in with drupal) amongst the two field to make them dependent on each other.

Resources