<p>Take a look at <a href="http://buildwithcraft.com/docs/routing#advanced-routing" rel="nofollow">Craft's advanced routing</a>. You'll need to define a regex pattern in order to create the named subpattern that you want, but once you've done that you can access the variable directly in your template.</p>

<p>In the following example {{ year }} and {{ month }} become available as variables in the news/_archive template</p>

<pre><code>'news/(?P&lt;year&gt;\d{4})/(?P&lt;month&gt;\d{2})' =&gt; 'news/_archive',
</code></pre>

CC BY-SA 3.0
2014-11-03T15:10:30.720Z
2014-11-03T15:10:30.720Z
Tyler Willingham
<p>I have a matrix with only one block type. and it only has videos ID's it (videoID). </p>

<p>I would like to have this videoID in the url and then fetch the corresponding Matrix Row. </p>

<p><a href="http://www.example.com/segment-1/segment-2/videoID" rel="nofollow">http://www.example.com/segment-1/segment-2/videoID</a></p>

<p>That said: I know I could get the matrix row ID like this: </p>

<pre><code>{% set test = craft.myMatrixField.id(craft.request.lastSegment()) %}
Video Id: {{ test.videoID }} 
</code></pre>

<p>But as the ID will change when reordering the matrix, I would like something more Permalink like and use the videoID in the URL.  </p>

<p>Anybody knows how to achieve something like this?  </p>

<matrix><navigation>
Making a navigation out of a matrix?
# Making a navigation out of a matrix?

(Asked by: username_0 on 2014-11-03)

I have a matrix with only one block type. and it only has videos ID's it (videoID). 
I would like to have this videoID in the url and then fetch the corresponding Matrix Row. 
http://www.example.com/segment-1/segment-2/videoID
That said: I know I could get the matrix row ID like this: 
{% set test = craft.myMatrixField.id(craft.request.lastSegment()) %}
Video Id: {{ test.videoID }} 

But as the ID will change when reordering the matrix, I would like something more Permalink like and use the videoID in the URL.  
Anybody knows how to achieve something like this?

**Tags:** matrix, navigation


---

## 1 answers

### Answer by username_1 on 2014-11-03. Score: 1

Take a look at Craft's advanced routing. You'll need to define a regex pattern in order to create the named subpattern that you want, but once you've done that you can access the variable directly in your template.
In the following example {{ year }} and {{ month }} become available as variables in the news/_archive template
'news/(?P\d{4})/(?P\d{2})' => 'news/_archive',


---

