Pagetitle trough PHP
Pagetitle trough PHP
Is there a way to dynamic change the page <title></title> element trough PHP, reflecting the content of a webyep short text element?
Re: Pagetitle trough PHP
Yes, you can use the WebYep API to fetch the contents of an element. For a ShortText element this would look like the following example.
Regular definition of a ShortText named "YourFieldName", not global:
Print the contents of the previously defined ShortText element:
Note that you must provide the same parameters to webyep_shortText() and webyep_sShortTextContent() and both code snippets must be on the same page.
Regular definition of a ShortText named "YourFieldName", not global:
Code: Select all
<?php webyep_shortText("YourFieldName", false); ?>
Print the contents of the previously defined ShortText element:
Code: Select all
<?php echo webyep_sShortTextContent("YourFieldName", false); ?>
Note that you must provide the same parameters to webyep_shortText() and webyep_sShortTextContent() and both code snippets must be on the same page.
Re: Pagetitle trough PHP
Thank you: that is very helpful!
-
- Posts: 1
- Joined: Tue Dec 20, 2011 6:52 pm
Re: Pagetitle trough PHP
For displaying the page title for your PHP page you have to write following code :
<html>
<head>
<title><?php print("$title"); ?></title>
</head>
<body</body>
</html>
<html>
<head>
<title><?php print("$title"); ?></title>
</head>
<body</body>
</html>