0

I would like to make a jump menu in Views that is displayed as an attachment to the same Views page, which displays a list of documents. I would like the jump menu to display the titles of all the documents, and have the destination for each link be an anchor tag on the same page, adjacent to the actual document.

I have applied output rewriting (in the Page display) to each document title, like this: <a id="[title]">[title]</a>. In my jump menu display, attached to the top of the page display, I can rewrite the output of the title field to be mypage#[title], and that works, but the items in the jump menu are ugly.

What do I need to do in order to make the items in the jump menu display simply as [title], but jump to mypage#[title]?

Thanks!

  • What do you mean with "ugly"? Perhaps a screenshot would help to clarify what exactly is the problem. – m1n0 Feb 12 '14 at 21:21
  • I mean that the entire path with # and title displays in the jump menu, rather than just the title. It seems that whatever text is displayed as the menu option is what Drupal tries to use for a URL when that option is selected. I was hoping that there was some way to display one thing, and have the URL path be something different, as above. – eljefejb Feb 12 '14 at 21:50
0

Add another title field for the document, which will have no rewriting at all and hide it from the output (checkbox "Exclude from display"). Then use this second title field when for displaying in jump menu.

  • Thanks, m1n0. This set me on the right track. For everyone else who may be trying to do this, the key is to have one version of the field to which you apply rewriting to structure your URL, and exclude that version of the field from display. Then include the normal (unmodified) field, which will be shown in the drop-down list. It seems that any fields which are not excluded from display make up the value of the option in the jump menu. – eljefejb Feb 13 '14 at 16:48
  • ...continued (got interrupted in the middle of editing) In order to have the URL set to the anchor link (the rewritten field), go into the settings for the jump list and select that field in the "Path Field" box. – eljefejb Feb 13 '14 at 16:56

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.