Toggle navigation
TechnoWikis.com
Email or Username
Password
Remember
Login
Register
|
I forgot my password
All Activity
Questions
Hot!
Pending
Ask a Question
Privacy Policy
Contact
Drupal - Custom types types
Home
Tutorials
Development
CMS
Drupal - Custom types types
(adsbygoogle = window.adsbygoogle || []).push({});
+4
votes
179
views
Drupal - Custom types types
asked
Jun 23, 2019
in
CMS
by
backtothefuture
(
552k
points)
reopened
Jun 23, 2019
|
179
views
answer
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Add answer
Cancel
1
Answer
+5
votes
Best answer
One of the features that makes
Drupal
one of the most popular content management systems, is its inherent ability at its core to define totally customized
content types
.
We click on
Structure
in the administration bar and then click on the
Content Types
section.
In the
Content type
screen, we click on the
Add content type
link.
In
Name
we enter
Recipe
as the name of our custom content type.
In order for our content type to have a base schema in HTML5 based on a recipe, we enter the following address in the description:
http://schema.org/Recipe
For the field of
Title field label
, enter
name
.
The reason why we change the default text of the
Title field field
from
Title
to
name
is that we are going to model our Recipe-type content type microdata based on HTML5.
This will provide a semantic definition of our content to increase the results in any search engine.
We click on
Save
.
Then we eliminate the
Body
field that is automatically added to our content type.
We click on the
delete
link and then confirm on the next screen.
Now we will add some new fields to our content type Recipe, the first property to add is the description.
We click on
Add new field
input
, we type description, in
prefix_label
we type description again and in the
widget we
select Text area and then
Save
.
On the next screen we confirm and press
Save field settings
.
On the
RECIPE SETTINGS
page we enter a brief description of the item, accept the rest of the default settings and click on
Save settings
.
Now we will go to the properties of the image, we will use an existing field for this property.
In the
Add existing field section
, enter image as the label.
And in the field
Field to share we
select the option
Images: field_image (image).
We click on the
Save field settings button
on the
FIELD SETTINGS
page.
On the next page, we click on the
accept the default settings button
for
RECIPE SETTINGS
and
IMAGE FIELD SETTINGS
.
The properties of
datePublished
and
author
will be captured by the property nodes of the Drupal kernel.
For the
cookTime
property the settings will be: label: cookTime, name: field_cooktime, type: Integer, widget: Text field.
We click on
Save
and accept the general settings on the next page.
On the next page we enter the time in minutes in the field The time it takes to actually cook the dish in minutes.
The properties of
cookingMethod
,
nutrition
,
recipeCategory
,
recipeCuisine
and
totalTime
will be added later.
For the
ingredients
property we add the necessary fields and save.
For the property of
prepTime
we add the necessary fields and save.
For the property of
recipeInstructions
we add the necessary fields and save.
With all of our added properties we should have our Recipe-type content that looks like this:
Just as we create a content type of Recipe type we can create another of any type without any inconvenience, that adapts to our page and the needs of it.
answered
Jun 23, 2019
by
stackoverflow
(
3.5m
points)
edited
Jun 23, 2019
ask related question
comment
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Add comment
Cancel
Related questions
+5
votes
1
answer
Creating personalized post in WordPress (Custom post types)
asked
Jun 24, 2019
in
CMS
by
backtothefuture
(
552k
points)
|
214
views
+4
votes
1
answer
Multilingual sites with Drupal
asked
Jun 24, 2019
in
CMS
by
backtothefuture
(
552k
points)
|
269
views
+3
votes
1
answer
Installing Drupal under Windows
asked
Jun 23, 2019
in
CMS
by
backtothefuture
(
552k
points)
|
192
views
Sponsored articles cost $40 per post. You can contact us via
Feedback
All categories
Tutorials
7.5k
Microsoft
1.9k
Android
1.4k
Security
120
Linux / Unix
543
Internet
757
Virtualization
104
Apple
611
Networks
64
Other Devices
321
Other Applications
184
Hardware
19
Development
53
HTML5 / CSS3
12
Web Servers
9
JavaScript
12
Other languages
2
PHP
8
CMS
4
Python
5
WebServers
1
Digital Marketing
47
Databases
14
Graphic Design
30
Guides
794
GraphicDesign
54
Networking
4
PlayStation
186
Gaming
55
Linux/Unix
85
Manzana
33
Otherdevices
38
Otherapps
49
Digitalmarketing
39
Safety
1
Developing
2
Help
685
Social Networks
34
Android Tutorial
549
iPhone Tutorial
267
News
17
Social
6
Phone
11
Telephone
9
Applications
167
Smartphones
3
Cell Phones
11
Applications
25
Travels
6
Photo
21
Education
18
Games
25
Internet
14
Music
8
Technique
10
Video
6
Windows
5
Apple
2
Cell Phones
3
TikTok
216
Trips
2
House
1
Operating System
5
Tips & Tricks
892
Solutions
6
Tutorials
3
FAQ
1
Applications
5
Cell Phones
2
Tutorials
4
Computers
6
Tutoriales
2
8
Technology
2
In Computers
1
In Applications
2
Tutorials Tutorials
9
Applications Applications
25
Aplicaciones Applications
4
Devices Devices
5
Tutoriales Tutorials
1
Tutorials u00a0 Tutorials
2
Applications u00a0 Applications
2
Devices u00a0 Devices
1
OS OS
1
Etc Etc
2
Most popular questions within the last 30 days
Please leave a comment about whether the solution works or not (with device model)
[X]Close
10,659
questions
10,791
answers
510
comments
3
users