Log in

View Full Version : adding conditional in headinclude


bongwater
10-23-2008, 11:16 AM
I would like my member profile pages to have customized meta keywords and descriptions with the following modified code:

<meta name="keywords" content="$userinfo[username],$vboptions[keywords]" />
<meta name="description" content="$userinfo[username] $vboptions[description]" />

I understand that this involves adding a conditional in the HEADINCLUDES template.

The question I have is, what is the variable to use that will call the memberinfo template? (see below)

<if condition="$show[????]">
****NEW META CODE ***
<if>


thanks

Lynne
10-23-2008, 01:39 PM
<if condition="THIS_SCRIPT == 'member'">
your stuff
</if>

bongwater
10-23-2008, 02:41 PM
thanks, but now it works partially for my desired result

Here is the added code in my headincludes template

<if condition="THIS_SCRIPT=='member'">
<meta name="keywords" content="$userinfo[username],$vboptions[keywords]" />
<meta name="description" content="$userinfo[username] $vboptions[description]" />


But when I load the profile page of a member in my browser and view the HTML code, the username doesnt show up in the meta tags. Instead, I see something like this:

<meta name="keywords" content=",keyword1,keyword2,keyword3" />
<meta name="description" content=" description..." />

Is $userinfo[username] the correct code to insert the username there, and am I missing any other code?

thanks