When using News Full content template, the title appears twice

Dear everyone,

I need to create a Content type that displays the News Full Content pattern. I want my articles to look exactly like the one from home.cern.

I have 3 questions:

  1. Is it recommended to create a new content type (eg. called “News”) or can I use the “Article” content type and just add the News full content display?

  2. So far, I have managed to create pages that look a lot like the home.cern ones except that the title appears twice. I cannot find anywhere to fix this on the “Manage display”. Anyone can figure out why?

  1. Finally, in order to copy the articles that are currently on our Drupal 7 website, or the news from home.cern, I need to tag other people than myself as authors. Currently, I can only tag a very little number of people. Any idea how / where I could fix this?

Many thanks!!

Marie

Hello Marie,

For what you are asking in questions 1 and 2 I can propose two solutions.

  • Pre-configured website: For the use case you mention ( “I want my website articles to look exactly like the home website”), we have created a template that you can use when you create a website. More specifically, when you create a new Drupal site, you are asked to choose a profile. If you choose the easy start profile then the created website will have out-of-box pre-configured content types that look like the home website.

04

For your use case (displaying news), you can use the News Page content type type to display your news. The screenshot below displays how news will be rendered in your website if you get an “Easy Start” website.

Since it is a quite “rich” website, I suggest to remove any Content types / Views / Blocks etc that they are not useful for your use case.

  • Configure your content type using the templates: For the second solution you make the configuration on your own. To do that I would suggest reading this How-to article of the webtools website that describes how to configure your content type to display the content as in the home website.

Since you posted in Beginners category, I guess the first solution is better for you.

For your 3rd question, when you edit a node you can modify the Author of the node (check screenshot below)

Hope that works for you! Feel free to answer in this post if you have further questions.

Konstantinos

Hi Kostas,

Thanks for your answer!

I indeed need to make the configuration on my own because my supervisor prefers me not to use the easy-start website which is too rich. He wants us to avoid having too many parasite components on our website.
So I have created the display myself, as explained in my first post. But the title appears twice. E.g. https://test-voisins2.web.cern.ch/female-ambassadors-science-visit-local-schools The rest is fine.

Regarding the author, I cannot select any of my other colleagues. I can select myself, you, Sotirios, but not Loraine Massarotti or François Briard for example, who have also written articles for our current voisins.cern website. I need to be able to select them and other people because I have to copy all the articles of the Drupal 7 webiste to the Drupal 8 one.

Can you help?

Thanks,

Marie

Hello Marie,

You mention two issues:

1) When I use the News Full Content template, the title is displayed twice

This is done because the one title is the one of the News Page and the top one is the block title of the page. You can remove it by navigating in /admin/structure/block/manage/cernclean_page_title and then configure the Page Title block.


In the block settings set it to render everywhere apart from News pages.

2) I cannot see accounts as authors of my articles

This happens because by default the Author field is a user of the website. User accounts are created when someone logs in the website for the first time. You can see the list of all accounts in /admin/people. Probably Francois has not logged in the website yet, thats why you cannot see his account. I propose 2 solutions.

Solution 1

Simply tell the authors to log in.

or…

Solution 2

Create a custom Author field which will be a reference to a taxonomy vocabulary. Then you create the authors as vocabulary terms and you dont have to wait for the users to Log In in order to see their accounts.

Thats all. Let me know if you have more questions.

Konstantinos

1 Like

Hi Kostas,

Thanks a lot for your help!

The title problem is now solved.

Regarding the author situation, I cannot decide which solution is best.

Solution 1 (tell the authors to log in) is not entirely possible since some authors of our Drupal 7 current website articles have left CERN a long time ago. But they should still be mentioned as authors while we copy their articles to the new website.

Regarding Solution 2 (creat a taxonomy), does that mean that each time someone new write an article in our website, we have to had him/her to our taxonomy?

Thanks for your input on that question.

Cheers,

Marie

Hello Marie,

In the case where you cannot “make” all the authors log in, i would suggest using the solution 2.

For solution 2, it means that for each person you should create a taxonomy term. To make it a bit more clear in steps:

  1. Create a Taxonomy Vocabulary with a nice name (eg. Authors)
  2. Within the vocabulary, create a term for each one of the Authors of your website.
  3. In your content type, create a field in your content type of type Entity Reference for taxonomies that allows you to tag content with the authors. In the vocabulary, choose the one you created in step 1.

Do I have to go to vocabulary and add a new term each time there is a new author?

Yes, however Drupal permits you to create new terms on-the-fly. Meaning that when you create your content and search for the author name, if the author does not exist then a new taxonomy term will be created with the name you just typed.

In order to do that:

  1. In the tagging field (step 3 from above) you need to set the tagging field to Create referenced entities if they dont already exist like in the image below.

  2. In Manage Form Display of your content type, you should set the tagging field to be rendered as autocomplete. That way, you will be able to type the new Author to be created.

Hope that helps. Let me know if something is unclear or you have more questions.

Konstantinos

Excellent, this is perfect, thanks!!

Hi there,
Two more questions about the News Full content.
How do I do to add the path “News > …” and the “Voir en français” to my display?

Thanks in advance,
Marie

Hi there,
Could anyone help with my preview request?
Right now, the title on the News full content are too close to the header in my website: https://test-voisins2.web.cern.ch/over-100-budding-geeks-participate-devoxx4kids-conference-cern
Is there a way to have the title downer?
Thanks!
Marie

Hello Marie,

You posted multiple questions so I am answering all of them in this post:

Answer
For that you need to set Topic and News Format pattern fields.

Answer
For that you need to translate your node. If there is no translation, there is no page to point to, hence there is no reason to display the block

Answer
The styles are pre-defined so the spaces are the same everywhere. I guess that if you add the aforementioned “Voir en francais” and/or breadcrumbs, the distance will expand. Try it and let me know.

Konstantinos

Hello there,

My News full content nodes look indeed better with the “Voir en français” on top of it.

There is still one important difference with the home.cern model I have used.
There is no space between the date and the body:

See, in comparison, the same article on home.cern : https://home.cern/news/news/cern/virtual-lectures-schools

Thanks for your help!

Marie

Hello Marie,

This happens because normally there is a main image between the date and the text. The image has the spacings (thats why you see it on home.cern). I will add spacing to the date too to fix the issue.

Konstantinos

Hello Marie,

I applied a fix for the issue and it resolves the spacing issue.

However this can also be resolved by mapping a field under the image pattern field because now its empty. Thats why you dont have any spacing, because it expects the image field. Either way with my fix it will work whether you have an image or not.

Konstantinos

I guess that I got confused because in the Webtools website recommandations, the image in the News full content is included in the Body:

Anyway, thanks for fixing the issue!!!

Have a nice day,

Marie