0

By default in Drupal 7, a taxonomy page lists the titles of all the nodes that have been tagged with that term.

Is there any way to make it so the page shows just the first node that is tagged with that term?

I want it so the first node is displayed in full (Ideally, the term page should automatically take the user to the first node).

I know you can use Views to override a taxonomy and control what content is shown. However, I would like to do this without views (i.e. so the user is seeing the acutal node as opposed to a view of the node).

I also want it to happen automatically (i.e. for every term, the first node should displayed. The admin of the site should not have to manually set up this state for each individual term).

1

The way to do this is to enable the "Taxonomy term" view in Views: enabling taxonomy term view Add and offset of 1 to the page view: editing pager offset

And then add and Attachment display that has a pager with an Offset of 0 and an Items per page as 1. On the attachment you can switch the Format to show full nodes instead of teasers. adding attachment display

This will work "automatically" for all Taxonomy terms. The reason this works is that the view takes an argument of the taxonomy term in the URL.

taxonomy view argument

It overrides Drupal core's url for Taxonomy terms and uses the view as a replacement.

  • Thanks for taking the time to reply. However, that solution uses a view as the replacement which is something I didn't want to do (see opening question). The reason for this is that my node uses custom theming in a node tpl file, which wont be carried over to the view. – big_smile Feb 21 '12 at 16:58
  • If you set the view mode to "Full content" for the attachment view it will display the output of the node tpl file. – acouch Feb 21 '12 at 17:54
  • That works brilliantly, except it shows the first two results. How can I limit it so it just displays the first one. – big_smile Feb 22 '12 at 11:58
  • Is that for the Attachment? It should show one result if you add offset '1' and results '1'. Did that work? – acouch Feb 22 '12 at 13:14
  • Thanks for your continued help. For the attachment I have: offset 1, results 1. For the page, I have Items per page 10, offset, 1. Is that correct? With these settings, it displays the first three. – big_smile Feb 22 '12 at 14:32

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.