So, I created a custom tag called {random_string length='n'} that generates a random string of 'n' characters. I have tested it and it works fine in a page template.
I assigned the value of {random_string length='5'} to a variable $randstring, using two methods, and both work in my test page:
http://benlueders.com/test
Method 1
Code: Select all
{capture name='randstring'}{random_string length='10'}{/capture]
Code: Select all
{random_string length='10' assign='randstring'}
Code: Select all
{random_string length='5' assign='randstring'}
{startExpandCollapse id="$randstring" title="$addacomment"}
...
bla bla bla
...
{endExpandCollapse}
Code: Select all
Error: The expand/collapse plugin requires that both parameters (id,title) are used.
If someone could help me with my syntax here or, suggest a simpler way to pass the news item id through to the comments template so I could use that, I would be very grateful.
Thanks again!
Addition:
I checked the Smarty documentation and found that using double quotes, Smarty will attempt to expand any variables inside the quotes. So id="$foo" should work if the variable $foo is declared. id=$foo should also work. See the next post, as I used various test cases for this bug.