inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on May 8, 2013 13:03:26 GMT -8
Coming with the next push is a new template feature, the ability to reference the name of the route directly in the template. You can use this new feature as simply as:
$[route.name] Or, if you want a little extra information, you can do something more like this:
{if $[route.name] == 'user'}{if $[route.params.user_id] == 1}I'm viewing the admin's profile!{/if}{/if} $[route] acts as a template version of the proboards.data('route'); that some of you may already be familiar with, and may be used in exactly the same ways. Because $[route.params] does not always contain the same data on every page, you will not see the possible options in the template editor. Instead, we recommend checking the JavaScript variable on the page of the template you are modifying.
Happy templating!
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Dec 28, 2013 14:11:13 GMT -8
Not really, jrryan - the route variable is more about determining where the current user is on the forum. Looking at Tim's example, the text "I'm viewing the admin's profile!" would only appear on the admin's profile because when the " $[route.name]" outputs " user" it means that the current user is looking at a profile, and when $[route.params.user_id] outputs 1, it means the profile being viewed is the admin's (as the admin always has the I.D. "1", being the first user to exist on the forum).
|
|
Former Member
inherit
guest@proboards.com
101401
0
Nov 25, 2024 10:59:26 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Dec 31, 2014 15:30:28 GMT -8
Would something like this be useful in a role playing forum?I'm still trying to figure out the purpose of templates as opposed to plug-ins.Im pushing myself more in learning the coding of proboards.I want to be more helpful.
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Jan 2, 2015 8:21:37 GMT -8
This could be used by any type of forum. It basically just allows the template to easily have a way of determining the current URL. What you do with the information is entirely up to you.
|
|