Answers.Body: <p>As a shorthand, you could also use <a href="http://buildwithcraft.com/docs/reference-tags" rel="nofollow noreferrer">Reference Tags</a> along with the <code>parseRefs</code> filter, like this:</p>
  
  <pre><code>&lt;a href="{{ '{entry:123:url}' | parseRefs }}"&gt;Request a Quote&lt;/a&gt;
  </code></pre>
  
  <p><em>(Similar question/answer posted <a href="https://craftcms.stackexchange.com/questions/769/how-do-i-create-a-link-to-an-entry-using-entrys-id">here</a>.)</em></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-01T18:41:04.440Z
Answers.Text: Question about whether this is performant, posted here: [http://craftcms.stackexchange.com/questions/6906/linking-to-specific-entries-in-twig-how-performant-is-reference-tags-parsing](http://craftcms.stackexchange.com/questions/6906/linking-to-specific-entries-in-twig-how-performant-is-reference-tags-parsing)
Answers.UserDisplayName: Michael Rog
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-01T18:23:56.453Z
Answers.LastActivityDate: 2015-02-01T18:23:56.453Z
Answers.LastEditDate: 2017-04-13T12:51:00.200Z
Answers.UserDisplayName: Michael Rog
Answers.Body: <p>First, you'll want to retrieve that entry specifically...</p>
  
  <pre><code>{% set entry = craft.entries.slug('get-a-quote').first %}
  </code></pre>
  
  <p>Once you've got the entry that you want to target, you can easily link to it like this:</p>
  
  <pre><code>&lt;a href="{{ entry.url }}" class="btn-quote"&gt;request a quote&lt;/a&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-23T20:22:18.167Z
Answers.Text: For some reason when I use the code above, it's not outputting the entry field below.  I created another discussion regarding the issue. Here's a [link](http://craftcms.stackexchange.com/questions/2685/entry-field-not-outputting-after-set-code-in-template?noredirect=1#comment3951_2685).  Maybe you can help me figure it out.  Thanks!
Answers.UserDisplayName: frshjb373
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-23T20:46:06.207Z
Answers.Text: Just left an answer on that thread... Looks like you'll need a different variable name than "entry" (since "entry" is already taken).
Answers.UserDisplayName: Lindsey D
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-09-21T01:23:10.403Z
Answers.LastActivityDate: 2014-09-21T01:23:10.403Z
Answers.UserDisplayName: Lindsey D
Body: <p>I have the following code and I'm looking for the best way to link to another entry page.</p>
  
  <pre><code>&lt;a href="#" class="btn-quote"&gt;request a quote&lt;/a&gt;
  </code></pre>
  
  <p>I tried something like this with no luck:</p>
  
  <pre><code>&lt;a href="{{ entry.getLink('Get a Quote') }}" class="btn-quote"&gt;request a quote&lt;/a&gt;
  </code></pre>
  
  <p>Here's the entry: <a href="http://grab.by/Ax6s" rel="nofollow">http://grab.by/Ax6s</a></p>
  
  <p>Thanks in advance for the help.</p>
  
Tags: <templating><url><entry>
Title: What's the best way to link to an entry in a template?
ThreadText: # What's the best way to link to an entry in a template?
  
  (Asked by: username_0 on 2014-09-20)
  
  I have the following code and I'm looking for the best way to link to another entry page.
  
  ```
  <a href="#" class="btn-quote">request a quote</a>
  
  ```
  
  I tried something like this with no luck:
  
  ```
  <a href="{{ entry.getLink('Get a Quote') }}" class="btn-quote">request a quote</a>
  
  ```
  
  Here's the entry: <http://grab.by/Ax6s>
  
  Thanks in advance for the help.
  
  **Tags:** templating, url, entry
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2014-09-21. Score: 4 | Accepted answer
  
  First, you'll want to retrieve that entry specifically...
  
  ```
  {% set entry = craft.entries.slug('get-a-quote').first %}
  
  ```
  
  Once you've got the entry that you want to target, you can easily link to it like this:
  
  ```
  <a href="{{ entry.url }}" class="btn-quote">request a quote</a>
  
  ```
  
  > **Comments:**
  > **username_0**: For some reason when I use the code above, it's not outputting the entry field below.  I created another discussion regarding the issue. Here's a [link](http://craftcms.stackexchange.com/questions/2685/entry-field-not-outputting-after-set-code-in-template?noredirect=1#comment3951_2685).  Maybe you can help me figure it out.  Thanks!  
  > **username_2**: Just left an answer on that thread... Looks like you'll need a different variable name than "entry" (since "entry" is already taken).  
  
  ---
  
  ### Answer by username_1 on 2015-02-01. Score: 2
  
  As a shorthand, you could also use [Reference Tags](http://buildwithcraft.com/docs/reference-tags) along with the `parseRefs` filter, like this:
  
  ```
  <a href="{{ '{entry:123:url}' | parseRefs }}">Request a Quote</a>
  
  ```
  
  *(Similar question/answer posted [here](https://craftcms.stackexchange.com/questions/769/how-do-i-create-a-link-to-an-entry-using-entrys-id).)*
  
  > **Comments:**
  > **username_1**: Question about whether this is performant, posted here: [http://craftcms.stackexchange.com/questions/6906/linking-to-specific-entries-in-twig-how-performant-is-reference-tags-parsing](http://craftcms.stackexchange.com/questions/6906/linking-to-specific-entries-in-twig-how-performant-is-reference-tags-parsing)  
  
  ---
  
  