When using OpenGraph tags, we'll need an 'unaliased' URL to reference a canonical location for the page. Not sure which of the following tokens makes the most sense

[url:unaliased]
[url:shortlink] (although this would only be the shortlink based on the same domain name, not an actual shortlink with tinyurl or similar)
[url:canonical] (see http://shiflett.org/blog/2009/apr/save-the-internet-with-rev-canonical, although can be confused with Google's interpretation of canonical which is the current 'nice' link, not the internal link)

Comments

dave reid’s picture

Title: Add an [url:unaliased] or [url:shortlink] token » Add an [url:shortlink] token

Let's go with [url:shortlink] as per http://code.google.com/p/shortlink/wiki/Specification

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new6.13 KB
dave reid’s picture

Title: Add an [url:shortlink] token » Add an [url:shortlink] and [url:canonical] token
StatusFileSize
new8.22 KB

Actually this might be better named [url:permalink]. I hate bikesheds.

dave reid’s picture

summit’s picture

Hi, am I correct that this patch brings the short-url into token as such.
1) Say I have product link field to an external url
2) I use [url:shortlink] token.
3) Now in views I got an url like tiny url..
4) Clicking on this I got the correct external url again.
Is this correct functionality?
Greetings,
Martijn

tkittich’s picture

Is there any update on this? Currently [current-page:url:absolute] and [current-page:url:unaliased] don't work correctly as canonical and shortlink for paths that have query strings, e.g. /taxonomy/term/8?page=42 . The query string, ?page=42, is missing from both [current-page:url:absolute] and [current-page:url:unaliased] .

tkittich’s picture

Issue summary: View changes

.

chris matthews’s picture

Assigned: dave reid » Unassigned
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 8 year old patch in #3 to token.test and token.tokens.inc does not apply to the latest token 7.x-1.x-dev and if still applicable needs to be rerolled.

Checking patch token.test...
error: while searching for:

  function testURLTokens() {
    $tokens = array(
      'absolute' => 'http://example.com/first-node',
      'relative' => base_path() . 'first-node',
      'path' => 'node/1',
      'alias' => 'first-node',
      'brief' => 'example.com/first-node',
    );
    $this->assertTokens('url', array('path' => 'node/1', 'options' => array('base_url' => 'http://example.com')), $tokens);
  }
}

error: patch failed: token.test:199
error: token.test: patch does not apply
Checking patch token.tokens.inc...
error: while searching for:
    'name' => t('Brief URL'),
    'description' => t('The URL without the protocol and trailing backslash.'),
  );

  // Array tokens.
  $info['types']['array'] = array(

error: patch failed: token.tokens.inc:266
error: token.tokens.inc: patch does not apply
andrew answer’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new7.72 KB

Patch re-rolled.

Status: Needs review » Needs work

The last submitted patch, 8: token-url_shortlink-1212576-8.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.