I am setting a website up that will house multiple language schools, so I am mainly dealing with:

Individual language schools Language courses

I set up a content type called ‘Schools’ and have fields on this that are unique to a specific school, example:

  • School Name
  • School Location
  • Tel no and contact details
  • Description of school

I then used entities for these things that are also unique to a school but there are quite a few of them, so I thought I’d be better with entities, then use inline reference entity fields on the school nodes (is this correct?):

  • Types of accommodation
  • Activities
  • Facilities
  • Image Gallery

Now I have come onto adding courses, there is generally a theme for these at the top level such as: ‘Intensive English’ then each school has various classes, so you mght have ‘Intensive English’ MORNING or ‘Intensive English’ EVENING. Now I don’t want to create taxonomies for this classes as I’ll have URLs that don’t have anything on them, I’d have a table with the various classes in it. But the whole website needs to be searchable.

My question is, what do I need to do for courses? I used entities but now can’t create a view that shows the nodes referencing the schools nodes and place it on the taxonomy parent: General English, Intensive English etc. Anyone got an pointers on what I should do and if I have set this up correctly?

I am struggling to create a view that shows a course page and then the schools that offer it, despite creating a reference to it, as in the image. Tried everything with contextual and relationships.

enter image description here

enter image description here

  • Hello, are we talking about Drupal 7 or Drupal 8 ? – O V Apr 4 '17 at 12:40
  • You can disable access to taxonomy paths with a module like Rabbit Hole. drupal.org/project/rabbit_hole – Kevin Apr 4 '17 at 14:11
  • @OlegVidenov - this is Drupal 7, sorry for not saying. – Rich Stevens Apr 5 '17 at 5:20

You're right, something that is a 'descriptor' or category is best left as Taxonomy (i.e. Time > Morning/Afternoon/Evening) where they are used to enrich the meaning of data.

Now I don’t want to create taxonomies for this classes as I’ll have URLs that don’t have anything on them

If access to taxonomy paths is a concern, you can install the Rabbit Hole module to disable access to it while preserving the functionality of taxonomy behind the scenes.

You can also use other modules like Taxonomy Views Integrator to 'change' the way taxonomy paths behave. In this modules case, you can display a View on these paths instead of the default page callback for taxonomy. The View can be anything you'd like.

Otherwise, if you attempt to create a custom table to store this data, you will need to use the appropriate hooks in the Views API to describe the table and it's data, and how it relates - which can be a lot of work. In the end, it sounds like you'd wind up duplicating taxonomy current functionality.

  • Thanks for the info. If I stick with what I have now: School as content type node, courses as entities, I can't seem to create a view which shows the course page, with the schools that provide this course. I added a entity reference field to my entity that references the school node, as you can see, but I can't work out how to do a view as mentioned. – Rich Stevens Apr 5 '17 at 5:21
  • Rabbit Hole simply doesn't work, whichever setting I put it onto, if I go use an incognito browser, the page simply shows up. Strange. – Rich Stevens Apr 5 '17 at 12:29
  • Works for me. Are you sure it is a term page and not already controlled by a view? – Kevin Apr 5 '17 at 12:30
  • I used it on a content type. Tried each setting, it still shows. – Rich Stevens Apr 5 '17 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.