I have posted 4 posts so far on the user forums and now I wrote my 5th one. So far didn't have any issue but now my post is not even being displayed because after I submitted it, it was marked as spam.

Meanwhile, while reading the API documentation pages, some of them is RIDDLED with spam comments bu nobody seems to have an issue with those. Odd.

This is the post I was trying to post.
https://www.drupal.org/forum/support/module-development-and-code-questio...

Content of my post was:

Title:
How to calculate and display something on an already existing page/view?

Content:
Hello,

In the past 13 or so days, I had nothing but frustrations trying to get started learning Drupal 8 custom module development. Reading the online documentation, example, purchasing 2 eBooks, watching 2 Lynda.com video series, watching another series on YouTube, and I am not even close to understand what this is all about and how this works. Not to mention, why does this has to be so complex!?

I'm not looking for a line-by-line code solution, just a general guideline/idea on how should I go about doing this simple sample exercise I came up with.

  1. 1. I created a content type for "people". It's very simple, all it has is the person's name and birthdate (date only), so you can use the form to input a few people.
  2. 2. I created a view that displays the list of people, their names and their birthdate. Of course everything so far is using the core admin thing.
  3. 3. Now, I wanted to create a custom module (or whatever), that calculates the person's age (based on the date stored in the DB). It takes today's date, subtracts the person's birthdate, and calculates their age.
  4. 4. Then, with some magic, it returns the age to the render/page output thing (whatever) and now this calculated value (the age) will be displayed on the view as well along with the person's name and birthdate. Makes sense?

How would I go about doing this? Again, I don't need a code sample that I can copy/paste, just some guidelines, since my main goal here is trying to understand how things work. What API should I use and such? Do I need a custom module? Or a custom view or something else...? I don't know. I can't even comprehend how to go about doing this deceptively simple example.

Thanks for some tips!

Comments

elpea created an issue. See original summary.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Priority: Critical » Normal
Status: Active » Fixed

I confirmed the account.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.