Add field when adding new content in Drupal - drupal

I'd like to ask a tricky question to you about Drupal.
I created a new content type which includes lots of fields.
I want to find a module that adds a 'Add another' link to the adding content screen which will duplicate certain fields.
Example:
I have fields named Panel1 Photo, Panel1 Info, Panel2 Photo, Panel2 Info...
When adding a new content of this type, if I want to enter 3 panels, I want this module to create 3 fields of Photo and Info for me, and maybe 4 or 5 at other times.
I hope you will understand what I ask.
Thank you in advance.

You could have each field set to allow multiple values which would put the add another button you talk about. If you make a field collection with the field collection module you will be able to group those fields together and you can allow multiple values for the field collection. Let me know if you haven't found the add another button.

Install the field collection module then in the content type create a field collection with panel and photo fields.
When you create your first content page you will start with one panel and photo and a + button. The + button gives you the ability to create ever more panels and photos grouped together.

Related

Drupal 8 - How to display content from field collection inside a region?

I'm pretty new to Drupal,
I have created a View with a custom content type which includes a field collection. When i try to load this view block inside a region in front page, It just shows the title (with the link to the actual content) and not the content itself. I need to view the content in the front-page itself
Can you please help me how to do this?
There are two options:
if in view you selected show format as content then you have to add your field collection field in selected display
if in view you selected shoq format as fields then you have to add your field collection field in view fields section

Rearrange child subtab in Netsuite

I have a requirement to have two custom record types under parent subtab arrange in order. I used parent-child relationship but the arrangement of the child subtab is something I couldnt customize. 'test one' and 'test two' are my custom record types, and Parent is item fulfillment record.
I want 'test one' to come first and then 'test two'.
I tried adding a new Subtab via customization under translation and this order customization is not available in netsuite. Am i missing anything?
Please help.
Edit the record
Click "customize" then "customize form" in the top right of the form
Navigate to "Lists" then select "Communication"
You can drag and drop your prefered order from this screen
Name then save the custom entry form
You can then manually select this form for the record or set it as the default form
If a field is visible on the form, then it appears somewhere in the Custom Entry Form screen. Which tab it's on depends on the type of field. It could be under Lists, or Fields, or elsewhere. Look for it.
When you find it, use the Field Group dropdown to move the field between the main view and sub tabs, and drag/drop the field to change its top-down display order. The drag handle looks like ⋮⋮.

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.

Drupal: Views: how to group fields

I've created a views of node and I've selected the "fields" option in order to select which fields to display and in which order.
Is there a way to group such fields ? It would be very useful to have parent divs in my html code.
thanks
There's a simpler way to do it: http://www.arsnova.cc/web-development-articles/2012-07-27/grouping-fields-together-drupal-views
Let's say you want to group fields 1-3 together within a div.
First, exclude fields 1 and 2 from display. (By "exclude", I do not mean to delete them from the views display; rather, click on the "exclude from display" button within each field's options.) The fields you exclude from display must come before the other field for this to work. If they don't, rearrange them so they do.
Go to field 3, and rewrite the results, inserting the token for each of fields 1-3.
That's all you need to do. Fields 1, 2, and 3 will now appear within field 3's div. If you want, you can also add additional markup within the "rewrite results" area.
Recently found the best way for my needs and apparently for the needs of many people:
Use views_fieldsets module https://drupal.org/project/views_fieldsets, it allows yo to create a grouping div to put fields inside.
Grouping is built into Drupal 8 Views. So no need for any extra modules. Here's how:
Edit your view (be sure it has fields)
Click Format's Settings
A box will pop up with all your selected fields
Look right underneath all the field names, there should be "Grouping field Nr.1"
Select the field you'd like to group by
Click Apply
If you want to subgroup with a second field, just go back to 2 then you'll see "Grouping field Nr.2"
That's it.
Yes, click on the gear next to the Style option (under Basic Settings) and set the Grouping field. Keep in mind, the grouping field needs to be added to the view, but you can check the Exclude from display option to hide it, if needed.
I'm pretty sure that would give you a parent div. If not, you could add the parent div, by overriding the default templates (look to the Theme: Information section, under Basic Settings, for more information).

checkbox for Drupal CCK

I'm new at Drupal. love it so far :)
I'm creating a CCK custom content type. I need to make a amenities list in checkbox format. so I made;
File Type: Text
Widget Type:
checkboxes/radiobuttons
and Allowed values list:
onsite_dining|Onsite Dining
meeting_space|Meeting Space
business_center|Business Center
and it creates Radio Buttons which only 1 selection :( How can I make it Check Box to give ability to select more than 1?
Appreciate helps!
There as an option: Number of values
You have to set it to something other than one.
This option is below the Required checkbox in the field settings page.

Resources