1 markfaulkner Nov 25, 2005 01:11
3 markfaulkner Nov 28, 2005 18:22
What I was thinking was similar to being able to check if a user is logged in with an if / else, and thereby display content unique to that circumstance.
Example:
<?php
if( is_logged_in() ){
$readername = $current_User->get('preferedname');
?>
Hello, <?php echo $readername; ?>!
<?php
}
else { // show this text to non-members
?>
Welcome, visitor. <a href="mailto:someaddress@domain.com">Contact me</a> if you want to become a site member.
<?php
} ?>
That I would be able to do an if / else but instead of checking for login I'd be able to check 'Which Blog was being viewed' and provide unique content to that circumstance.
What I don't know is the php to accomplish this. I'm assuming there is something along the lines of
if(is_blog=2)
or something ?
Attention appreciated!
4 kweb Nov 28, 2005 19:09
This ought to do it
if ($blog == 2)
There is a $blog variable that holds the blog number. I'm not sure how you are getting the content for your portlet, but you should be able to pass this variable to your portlet via URL (if you are accessing it from another site) or just check it directly it if the portlet code is running within your page (via include or something).