Note that there are some explanatory texts on larger screens.

plurals
  1. PODisable specific divs in CakePHP based on page selected
    primarykey
    data
    text
    <p>I'm new with CakePHP and I need your assistance. I need to display a specific widget which is in the form of a div on a specific page i.e. my homepage and disable on the rest of the pages. Essentially I have been able to specifically display specific divs based on log in status as indicated below:</p> <pre><code> &lt;?php if (!$this-&gt;Session-&gt;read('Auth.User.id')): ?&gt; &lt;div class="register link right &lt;?php if ($active == 'register') echo 'active'; ?&gt;"&gt;&lt;?php echo $html-&gt;link('Register', array('controller' =&gt; 'users', 'action' =&gt; 'register')); ?&gt;&lt;/div&gt; &lt;div class="login link right &lt;?php if ($active == 'login') echo 'active'; ?&gt;"&gt;&lt;?php echo $html-&gt;link('Login', array('controller' =&gt; 'users', 'action' =&gt; 'login')); ?&gt;&lt;/div&gt; &lt;?php else: ?&gt; &lt;div class="logout link right"&gt;&lt;?php echo $html-&gt;link('Logout', array('controller' =&gt; 'users', 'action' =&gt; 'logout')); ?&gt;&lt;/div&gt; &lt;div class="myaccount link right &lt;?php if ($active == 'myaccount') echo 'active'; ?&gt;"&gt;&lt;?php echo $html-&gt;link('My account', array('controller' =&gt; 'account', 'action' =&gt; 'summary')); ?&gt;&lt;/div&gt; &lt;?php endif; ?&gt; </code></pre> <p>I was asking for any help with regards to displaying a specific div based on the selection of my homepage. </p> <p>The pseudocode below indicates my the line of thinking I'm taking to solve this issue:</p> <pre><code> &lt;?php if (the selected page is homepage or default.ctp)?&gt; // set the display property for the desired div to none &lt;?php else: ?&gt; // do not set the display property for the desired div to none &lt;?php endif; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload