1

First, a disclaimer: I am less than a year into learning Drupal just to give you a frame of reference. I am probably using incorrect terminology in my searches so if there is an answer out there, a point in the right direction would be greatly appreciated.

I am building a site that will have multiple "categories." In each category, there will be page content. So, my URL will (should) look like this:

www.example.com/category/page

All of my pages have been put into their respective subdirectories which are named for their categories. For example:

widgets/page1  (node 10)
widgets/page2 (node 13)
widgets/page3 (node 24)
services/page1 (node 12)
services/page2 (node 15)
services/page3 (node 17)

If I type the url /widgets/page1 I get the "article" not the view. If I type in the url with node id:

www.example.com/widgets/13

The view works perfectly and shows me widgets/page2

I created a page view for widges and set its path to "widgets" so the url would be:

www.example.com/widgets

I have created a view that displays all my relevant info. I also created an "attachment" that shows me related content from the same category. This actually works quite well - it displays all the relevant content with linkable titles.

The problem that I am running into is when I click on one of the titles (or type the link directly) it no longer goes through the page view.

How do I structure this so that all links go through the views? I am missing something, I just don't know what.

Screenshot of my Views Pageenter image description here

6
  • Can you clarify the question - are you trying to fix the paths so that when a user goes to URL widgets/page2 it shows the view, or are you just trying to fix the links on the master view to point to the right "subview"? two very different issues... Jun 8, 2015 at 14:14
  • Yes, I am trying to fix/figure out the paths so they all go through the view. But that creates another question.... What are subviews?
    – Allan
    Jun 8, 2015 at 16:37
  • Sorry, used subviews but meant the views/pages the master view links to. In your view, you can customize the URL pattern in your links to, check out the answer in this post: drupal.stackexchange.com/questions/45668/custom-links-in-views Another option would be to look at the view that generates your pages, and see if you specified the right path to the view (first option "Path" under Page Settings). If you can attach a screengrab of your view, can try to provide more concrete instructions Jun 8, 2015 at 16:51
  • I attached a screen shot..I have used (from my site) .com/little and .com/little/%
    – Allan
    Jun 8, 2015 at 18:11
  • Ok, under Fields, click on the Title, then tick "Link this field to the original piece of content", then under "Rewrite results" tick "Output this field as a link", then in Link Path below it try "widgets/[nid]" then save obviously! Jun 8, 2015 at 18:30

1 Answer 1

0

Ok, under Fields, click on the Title, then tick "Link this field to the original piece of content", then under "Rewrite results" tick "Output this field as a link", then in Link Path below it try "widgets/[nid]" then save obviously!

3
  • Awesome, but now I have more questions, but I am going to experiment with rewriting the output. I see that %1 is the node title and would prefer to use that rather than a simple node number.
    – Allan
    Jun 8, 2015 at 20:12
  • You can use other tokens to play around with the paths/links/URLs, like the title etc. This is a handy ref: drupal.org/node/390482#drupal7tokenslist Jun 8, 2015 at 22:14
  • @Allan, if you are trying to point to the page's alias instead of the nid, try to use this 'widgets/[node:menu-link:url:alias]' in the link path as instructed above. Jun 10, 2015 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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