Hi all,

Thx for your wonderfull job.

For Node:Type I selected "Output this field as a link" and wrote link path as : references/[type]

The problem is that [type] write Node:Type only with human readable name and not machine name.
For example link appears
.../references/Hotel
instead of
.../references/hotel

So my other Views2 page ".../references/" can't use argument Node:Type correctly.

Is there a way to do it as I would want ?

Thx a lot.

Comments

srobert72’s picture

Could it be possible to have choice between human value and machine value ?

merlinofchaos’s picture

Category: support » feature

A checkbox or radio button could probably be added to the filter to switch which value is displayed.

dawehner’s picture

Status: Active » Needs review
StatusFileSize
new1.38 KB

Here it is

merlinofchaos’s picture

Status: Needs review » Needs work

1) The description of the field needs a . at the end. Also story and Story should be in quotes.
2) The machine readable name should not be translated, so t() should only be on the human readable version.

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new1.52 KB

updated patch. Thx for the feedback

dagmar’s picture

Status: Needs review » Needs work

Mmm, I think this is redundant, or at least, not recommended by the Drupal API

+      return $this->render_link(t(check_plain($value->{$display})), $values);

What do you think about?

+      return $this->render_link(t('@display', array('@display' => $value->{$display})), $values);
dawehner’s picture

Mh ... The value itself will not be translated..... Is this really wanted?

dagmar’s picture

We don't know if a certain language doesn't need to include something else to content type name.

This string will not be present in the language settings page.

dawehner’s picture

Ok this makes sense.

dawehner’s picture

But it should be @type or @typename.

merlinofchaos’s picture

The human readable name for a node type has to go through t() -- there are examples of doing it in core.

dawehner’s picture

So, but should we wrap this within an extra t function?

dawehner’s picture

Status: Needs work » Closed (duplicate)

This is already in views 2.11

Beside a switch for human readable it's a switch to enable machine name.