View of upcoming events

Hi all,

I am a complete newbie in drupal. I would like to have a site with a number of events, from which I show a list of the next few shortly upcoming ones. I created some content of type Event with the CERN agenda item, and prepared a view to select those. But I am facing a number of problems:

  • the content selected does not get ordered by the start date although I had defined that in the view’s definition;
  • the display always shows the “submitted by …” and I have no idea on how to change that; in fact, I do not know how to change the Display Mode - I can create one, but do not have the slightest clue on where I can define it.

Any help or other ideas on how to achieve my goal are very welcome.

Cheers,
Ralf.

Hi Ralf,

Can you share a screenshot of the View configuration?

For info, this is what I have for: Meetings | WLCG (maybe slightly more complex that what you want, but the key is in the sort criteria)

Screenshot 2023-01-20 at 09.19.27

Would be good to see what you have so we can advise.

-c

Hi -c, :wink:

Thanks for your reply. Of course, below is a screenshot of my first attempts at such a list:

You might also have a look directly at ep-afc-tsc-sandbox

Cheers,
Ralf.

Hi Ralf,

Ah, sorry, I thought my name appeared up top but it doesn’t. I’m Cath :sweat_smile:

OK, I see the URL I need to look at is Calendar - 1 | EP Graduates & Students and you’re trying to use a Grid layout. Just to confirm, are you trying to replicate the look/layout at Ongoing and Upcoming Events | CERN ?

But firstly, let’s at least get the filter and sort working, then we can worry about format later. So try the following, and let me know how you get on.

  1. Set format to Table (like in my WLCG example)
  2. Under Filter, add Content: Published (=Yes)
  3. Under Fields, delete Content Revision: Title
  • Insert Content: Title and Content: Start Date (you can find these just by searching on title and start date, but choose Content not Content Revision)
  1. Under Sort Criteria, remove the ‘Expose this to users’ tick, and set this field’s Sort Order to ‘Ascending’

This is just to get the basics working. Can you try that, and let us know if you get a correctly ordered table of events like at Meetings | WLCG ?

-cath :slight_smile:

Hi Cath,

Nice to meet you … virtually :slight_smile:

Yes, you are looking at one of my attempts - the sandbox is actually more of my try-it-out concepts area. And I would indeed like to have something like the [Ongoing and Upcoming Events] … of course, with some (very?) different formatting :wink:

I have followed your instructions and get a better result now (still not perfect):

Looks like the start dates are empty, and that is why the sorting doesn’t work - but if I look at the content, the start date is filled … Any suggestion?

Cheers,
Ralf.

Hi Ralf,

I think it’s easier if you add me to the admins for the site - it’s quite hard to diagnose without seeing under the hood, as it could be several different things.

Already I can see that the Start Date field is not one that corresponds to the content type you’re using for this view… but there are a few other issues I suspect might also be there waiting to trip you up, so if you don’t mind me being an admin for the afternoon, then I’m happy to dive in.

-cath

Hi Cath,

Thank you very much for your help. I wanted to give you administrator role from inside drupal, but the page told me that this is disabled. So, I added you to the admin e-group that I had created for my site. Unfortunately, I still cannot you see having administrator role. Does it need some time for synchronisation or do I have to do it some other way?

Cheers,
Ralf

Dear Cath,

You should have administrator access now … it took a while …

In the meantime I realised that the CERN agenda items I created do not have a start date in the view at all. I must have misunderstood what those items are supposed to do. Anyway, I have created my own content type “AFCEvent” and the start date (and other information) now show correctly in the view, and can be sorted correctly according to the content fileds. There is a new page with that view at /afc … so, what I interested to know now is how to transform that into the nice layout of the Ongoing and Upcoming events you showed me.

As a newbie I must say that I am a bit lost with the terms used by Drupal: Content, View, Display, Page … I couldn’t find a good diagram explaining all the entities and their relationships - it also seems to have been changing a lot over the recent releases - maybe, you know a good one?
And although the structural aspects are getting a bit clearer, I am struggling even more to understand where the format can be defined - where is the place to add some CSS to my pages?

Cheers,
Ralf.

Hi Ralf,

Yes, I can access as admin, no problem now. I’m sorry I haven’t replied sooner, I’ve been on training today.

Indeed yes, when building a View, you need to ensure that the fields you select exist in the content type you have defined! Otherwise, as you saw, there is a blank… because that field doesn’t exist…

Honestly, I have never use the “CERN agenda item” component as a field, so I wouldn’t personally use that.

OK…

There is a new page with that view at /afc … so, what I interested to know now is how to transform that into the nice layout of the Ongoing and Upcoming events you showed me.

You can follow the instructions at: Sign in to CERN

The actual View configuration will look similar to this (which is very simple):

The layout is completed using the ‘Format’ section here in the View… which calls upon format configurations you’ve done to your content type (described at Sign in to CERN )

DO NOT inject your own CSS - there is no need (certainly not at this point while setting everything up). A large amount of automatic formatting has been prepared for us by the Drupal Team, so best lean on that first and THEN decide if you need to change anything.

Ping me on Mattermost (@ noble) if you need more - faster response and I can explain stuff there :slight_smile: We can update this ticket a bit later with the result after you’ve understood how it all works more.

By the way - did you do the basic Drupal training at CERN? Just so I can get an idea of what you’re likely to know.

-cath