I'm using several views with page displays having menu items, titles and paths. I'm also using custom breadcrumbs, which are utilizing tokens for building the breadcrumb.

So right now if i want to mention the view in the breadcrumb trail, i have to copy the view title and path from the view to the breadcrumb setting. I think it makes sense to have tokens carrying these data.

I haven't tested views 3 for this feature (neither dev versions), and did only a sporadic search in the issues. If this is implemented already or discussed somewhere else i apologize for spam.

CommentFileSizeAuthor
#11 token_contrib.patch3.88 KBwapnik
#6 token.patch3.5 KBwapnik
#1 views.patch3.34 KBwapnik

Comments

wapnik’s picture

Version: 6.x-2.10 » 6.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new3.34 KB

Patch here (for 6.2-dev). Provides path and title tokens for displays of enabled views, where these paths and titles are set.

dawehner’s picture

Currently the behavior to integrate other contrib modules is that they implement this for views. See rules as an example.

Here this might be different, because token is part of core for 3.x

wapnik’s picture

As far as i know token module (for drupal 6) implements tokens for core parts. Views is not a part of the core. For example cck (for drupal 6) implements its own tokens for its content fields by itself. I assumed this should be the way with views too.

For 3.x implementation i think in this case it would be not much different from this 2.x.

dawehner’s picture

See rules as example.

wapnik’s picture

Title: Additional tokens » Additional tokens for views
Project: Views (for Drupal 7) » Token
Version: 6.x-2.x-dev » 6.x-1.x-dev

Ok i moved and reimplemented this to the token module. Patch for token 6.x-1.x-dev included.

wapnik’s picture

StatusFileSize
new3.5 KB

now included

Status: Needs review » Needs work

The last submitted patch, token.patch, failed testing.

wapnik’s picture

Status: Needs work » Needs review

#6: token.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, token.patch, failed testing.

dave reid’s picture

Since *Views* is not in core, we should and cannot add these tokens in token.module.

Although I'm not exactly unopposed to having some kind of token_contrib.module included in token.module that would provide fun tokens like block output, views output, etc.

wapnik’s picture

Status: Needs work » Needs review
StatusFileSize
new3.88 KB

Ok so i created the token_contrib.module starting with this views support.

Status: Needs review » Needs work

The last submitted patch, token_contrib.patch, failed testing.

wapnik’s picture

Status: Needs work » Needs review

So is this the right way to go?

MGN’s picture

Would this code be better integrated with the tokenSTARTER module? It seems consistent with the purpose of that module.

wapnik’s picture

I thought that's only an example module serving as a template for new modules implementing tokens.

kenorb’s picture

+1

ñull’s picture

+1

dave reid’s picture

Status: Needs review » Closed (won't fix)

You should put this code in a sandbox project to share. This will not be appropriate to put in token.module.