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.
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.
Set format to Table (like in my WLCG example)
Under Filter, add Content: Published (=Yes)
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)
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 ?
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
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?
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.
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?
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?
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.
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 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.