Node:Type link replacement patterns

srobert72 - August 11, 2009 - 07:50
Project:Views
Version:6.x-2.x-dev
Component:node data
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:Node:Type, Replacement patterns
Description

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.

#1

srobert72 - December 25, 2009 - 19:09

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

#2

merlinofchaos - December 25, 2009 - 19:56
Category:support request» feature request

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

#3

dereine - December 26, 2009 - 09:11
Status:active» needs review

Here it is

AttachmentSize
views-545738_node_type_display.patch 1.38 KB

#4

merlinofchaos - March 11, 2010 - 23:21
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.

#5

dereine - March 12, 2010 - 09:18
Status:needs work» needs review

updated patch. Thx for the feedback

AttachmentSize
views-545738_node_type_display.patch 1.52 KB

#6

dagmar - March 12, 2010 - 12:59
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);

#7

dereine - March 12, 2010 - 13:20

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

#8

dagmar - March 12, 2010 - 13:30

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.

#9

dereine - March 12, 2010 - 14:24

Ok this makes sense.

#10

dereine - March 12, 2010 - 14:25

But it should be @type or @typename.

#11

merlinofchaos - March 12, 2010 - 16:42

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

#12

dereine - March 12, 2010 - 18:29

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

 
 

Drupal is a registered trademark of Dries Buytaert.