Article photo exists

From Photostand Wiki

Jump to: navigation, search
article_photo_exifs(string)

The article_photo_exifs will display the value defined in the string parameter if there's at least one photo associated to the current article. This function may only be used in the index.php page.

This function is used to avoid displaying useless HTML tags.

Parameters

  • String : String value

HTML value that must be displayed if there's at least one photo associated to the article.

Examples

Displaying photos

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>

	<title>Article</title>

    </head>
    <body>

        <?php echo article_photo_exists('<ul>'); ?>
	    <?php echo article_photo('<li>', '</li>'); ?>
	<?php echo article_photo_exists('</ul>'); ?>

    </body>
</html>

Without the article_photo_exists function, the <ul> and </ul> tags would have been displayed even if there wasn't any photos with the article. To avoid this problem, put all the HTML tags related to the photos in an article_photo_exists function, just like in the example above.

Personal tools