0
votes

I am quite new to drupal. Only 2 weeks into this CMS. I need to create a custom content type( A page with more fields and content instead of a basic page). So a user must be able just fill up a form which will add a page.

I created different content types for different parts of the page. For example: I have created content type called "event". Using that I created 10 events. Now user must be able to add whichever the events he wants on the page.

There is a field type called "reference" that refers to the content. But, it only gives me a link. I need to show fields from all different content types combined in one content type(The page content type that I am creating).

I need to use my own html for displaying the information on this page. If I use views, it's creating it's own html and also I don't want all fields to be displayed same.

So basically I just want field values from the content so I can display them as I like. Right now, I am completely confused by Twig templating system. I tried several tutorials but, none of them really shows what I wanted to do. It's a very basic requirement and I did this with wordpress with out any problems. Using WP_Query we can get posts of any post type and we can show any of the fields of those posts. I am not sure how to achieve the same in drupal. I am using drupal 8 version.

2

2 Answers

0
votes

You shouldn't be using that many content-types. Try to keep it with 1 content type and further populating it with taxonomies and entities.

Anyway, to answer your question: You can show your content in full mode or a teaser mode. You can customize these modes to show to your liking. You might want to look at this module, it will help you a lot. https://www.drupal.org/project/ds

0
votes

1st method: Create a field of type "entity reference". In this field parameter , use a view that display that specific field from the other content type

2nd method : create a view with relationships