Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How do I extract values from $Head
TerminalAddict
New
In an attempt to make my site a bit more SEO friendly I would like to extract values from {asset name='Head'} to use elsewhere in the body of the template.
The first problem I have is how do I extract info from {asset name='Head'} ?
As an example, I would like to use the contents of
a bit "grep'ing" shows me this: Gdn_Format::Text($Title)
Is it relevant ? can I use this variable somewhere else?
that's problem 1.
Problem 2:
Smarty templates .. never really bothered to learn them lazy I know.
BUt I've discovered pretty quickly that I can't use php directly in the tpl.
How and what do I do if I want do something simple like
more specifically I would like to
Appreciate any help.
The first problem I have is how do I extract info from {asset name='Head'} ?
As an example, I would like to use the contents of
<title>
in the body of my document.a bit "grep'ing" shows me this: Gdn_Format::Text($Title)
Is it relevant ? can I use this variable somewhere else?
that's problem 1.
Problem 2:
Smarty templates .. never really bothered to learn them lazy I know.
BUt I've discovered pretty quickly that I can't use php directly in the tpl.
How and what do I do if I want do something simple like
<?php echo "some text here" ?>
which clearly does not work in a tplmore specifically I would like to
<?php echo Gdn_Format::Text($Title); ?>
Appreciate any help.
0
Comments
http://www.smarty.net/syntax_comparison
I still haven't figured out how to get any stuff out of {asset name='Head'}
I'd like to be able to use the title elsewhere
First, you don't have to use the smarty version of the template file. You can choose to use a straight-up PHP version. For an example, grab this file and use it instead of your master.tpl: /applications/dashboard/views/default.master.php
With that, you'll be able to use pure PHP in your master view.
Second, depending on what you're going for, there are easier ways to get it. For example, the value in the title tag is built using the head module's Title() method. You can get it's value by going $this->Head->Title(); in the master view.
What other values are you trying to access?
on to my next question about standard="1"