IMPORTANT ANNOUNCEMENT

These forums were permanently set to read-only mode on July 20, 2022. From that day onwards, no new posting or comment is allowed on the site, but the historical content remains intact and searchable.

A new location for posting questions about PlanetPress Suite is now available:

OL Learn - PlanetPress Classic (opens in new tab)

Topic Options
#39991 - 07/04/12 08:49 AM Language & variables in PSMW
ppuserd Offline
OL Guru

Registered: 07/03/12
Posts: 106
i would like to change my welcome page and tap into the variables as shown in the default html:

"<p>%salutation%</p> = "Dear Mr./Mrs. Lastname"

%salutation% seems to be the only one that works. if i, for example, try to use

"%fcFirstName%"

nothing happens although the following works perfectly in template.php:

"<? $user_name = $_SESSION['User']['fcFirstName']; echo $user_name; ?>"

1)is there a way to change %salutation% si that it will only display a first name
2)can you tell me how to create my own variables for PSMW, allowing me to use %firstname% for example.

thx for your help pn this

Top
#39993 - 07/04/12 12:32 PM Re: Language & variables in PSMW [Re: ppuserd]
ppuserd Offline
OL Guru

Registered: 07/03/12
Posts: 106
ah.. okay this is a little tricky but i guess others may need to customize the welcome page at some point so here goes.

what you need to do is define the variable as above in php but then use javascript to replace a string on the page like so:

<script language="javascript">
$("document").ready( function() {
Var texttoreplace = $(“#welcomeFormContent”).val();
$("#text").val(texttoreplace.replace('%firstname%', '<?echo($user_name);?>'));
} );
</script>

done.

i'd also recommend taking a copy of template.php and renaming to template-welcome.php just in case you mess up :-)

Top