How to make both appear on edit mode?

Permalink
Hey guys. I have code below:

<? $u = new User(); if ((!$u->isRegistered()) || $c->isEditMode()) { ?>
<td width="218" valign="top">                                 
<? $a = new Area('Home - Guess - Product 01 '); $a->display($c); ?>
</td>
<? } else { ?>
<td width="218" valign="top">
<? $a = new Area('Home - Member - Product 01 '); $a->display($c); ?>
</td>
<? } ?>


The top one only can be view by guess and the bottom only for registered user.

But how to make both appear on the edit mode?

Thanks!

traisoon
 
olliephillips replied on at Permalink Reply
olliephillips
There's every chance I dont' understand what you are trying to achieve, but based on what you've posted....

<?php 
if($c->isEditMode()){
   $u = new User(); 
   if ((!$u->isRegistered())) { 
   ?>
      <td width="218" valign="top">                                 
      <?php 
      $a = new Area('Home - Guess - Product 01 '); $a->display($c);
      ?>
      </td>
      <?php 
   } else { 
      ?>
      <td width="218" valign="top">
      <?php


I've just wrapped the whole lot in an isEditMode() if test

Hope that helps
12345j replied on at Permalink Reply
12345j
shouldn't they both appear automatically if you're the super user?
Mnkras replied on at Permalink Reply
Mnkras
no, you would have to add an $u->issuperuser or something