Ok i finally figured out to get my small content block to line up the way I want on my custom index. Now I want them to go away when someone logs in.
It is my inderstanding this is the proper piece of cose to use:
<?php
if (!isloggedin()) { CODE GOES HERE? }
?>
Well when I wrap my div blocks in the brackets {} and reload my page the page is blank.
Here is the code for my custom index.
<div id="custom_index">
<!-- Top Box with Login and Banner -->
<div id="index_welcome">
<?php
if (isloggedin()){
echo "<h2>" . elgg_echo("welcome") . " ";
echo $vars['user']->name;
echo "</h2>";
}
?>
<?php
//include a view that plugins can extend
echo elgg_view("index/lefthandside");
?>
<?php
//this displays some content when the user is logged out
if (!isloggedin()){
//display the login form
echo $vars['area1'];
}
?>
<div id="mem-box">
<div id="mem-box-content">
<h2>For Members</h2>
<div id="list-box">
<ul>
<li><strong>Network:</strong><br/>
Meet others interested in the topic of survival and self sufficiency.</li>
<li><strong>Share and learn:</strong><br/>
Pass along ideas and information important to the community</li>
<li><strong>Communicate:</strong><br/>
Get you message out to your friends and the community</li>
<ul>
</div>
</div>
</div>
<div id="gru-box">
<div id="gru-box-content">
<h2>Features</h2>
<div id="list-box">
<ul>
<li>
<strong>Customizable Profiles</strong><br/>
</li>
<li>
<strong>Personal Blogs</strong><br/>
</li>
<li>
<strong>Video and Photo Albums</strong><br/>
</li>
<li>
<strong>Video and Photo Albums</strong><br/>
</li>
<li>
<strong>Video and Photo Albums</strong><br/>
</li>
<li>
<strong>Video and Photo Albums</strong><br/>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- Middle Box with River -->
<div class="index_box">
<div>
<!-- latest Content River -->
<?php
$title = elgg_view_title(elgg_echo('content:latest'));
set_context('search');
$content = list_registered_entities(0,10,true,false,array('object','group'));
echo $title . $content;
?>
<!-- Left Box with New Members -->
<div id="index_left">
<div id="members_box">
<h2><?php echo elgg_echo("custom:members"); ?></h2>
<div class="index_newmembers">
<?php
if(isset($vars['area3'])) {
//display member avatars
foreach($vars['area3'] as $members){
echo "<div class=\"index_members\">";
echo elgg_view("profile/icon",array('entity' => $members, 'size' => 'small'));
echo "</div>";
}
}
?>
<div class="clearfloat"></div>
</div>
</div>
</div>
<div id="index_right">
<div id="tag_box">
<h2>Tags</h2>
<div id="index_tags">
<?php
$notags = 100;
if ( $vars['entity']->notags ) {
$notags = $vars['entity']->notags;
}
echo display_tagcloud( 1, $notags, "tags" );
?>
<div class="clearfloat"></div>
</div>
</div>
</div>
</div>
</div>
</div>
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- landshark@landshark
landshark - 0 likes
- landshark@landshark
landshark - 0 likes
- Phil@Phil
Phil - 0 likes
You must log in to post replies.Here is the section I want to remove when logged in:
<div id="mem-box">
<div id="mem-box-content">
<h2>For Members</h2>
<div id="list-box">
<ul>
<li><strong>Network:</strong><br/>
Meet others interested in the topic of survival and self sufficiency.</li>
<li><strong>Share and learn:</strong><br/>
Pass along ideas and information important to the community</li>
<li><strong>Communicate:</strong><br/>
Get you message out to your friends and the community</li>
<ul>
</div>
</div>
</div>
<div id="gru-box">
<div id="gru-box-content">
<h2>Features</h2>
<div id="list-box">
<ul>
<li>
<strong>Customizable Profiles</strong><br/>
</li>
<li>
<strong>Personal Blogs</strong><br/>
</li>
<li>
<strong>Video and Photo Albums</strong><br/>
</li>
<li>
<strong>Video and Photo Albums</strong><br/>
</li>
<li>
<strong>Video and Photo Albums</strong><br/>
</li>
<li>
<strong>Video and Photo Albums</strong><br/>
</li>
</ul>
</div>
</div>
</div>
</div>
Does anyone know what I'm doing wrong?
Fixed it.
For those that also might have a problem.
<?php if (!isloggedin()){ ?>
CODE GOES HERE
<?php } ?>
Just so as you know landshark ... I'm thankful you bothered to post the solution when you found it, it's been useful to me :)
cheers