New Module issues

Support desk for Multipurpose Quark Theme
GK User
Sun Dec 13, 2015 9:21 pm
This is the new code I wrote into the default.php file:
Code: Select all
          <?php if($this->API->modules('header') && $item_id != $error_item_id) : ?>
          <?php if($this->API->modules('header_search') && $item_id != $error_item_id) : ?>
          <?php if($this->API->modules('header_content') && $item_id != $error_item_id) : ?>
          <div id="gkHeaderMod" class="gk-clearfix">
             <jdoc:include type="modules" name="header" style="none" />
             <div class="header_search"><jdoc:include type="modules" name="header_search" style="none" /></div>
             <div class="header_content"><jdoc:include type="modules" name="header_content" style="none" /></div>
         </div>
          <?php endif; ?>
          <?php endif; ?>
          <?php endif; ?>


Now, with the new header_search and header_content module positions if I don't have modules published in those positions the header module doesn't display.

I need help getting the modules to display properly.

Thanks,
James
User avatar
Junior Boarder

GK User
Mon Dec 14, 2015 10:07 am
Its because you have logical AND statement between the lines, so the code will display only if:
Code: Select all
$this->API->modules('header') && $item_id != $error_item_id
AND
$this->API->modules('header_search') && $item_id != $error_item_id
AND
if($this->API->modules('header_content') && $item_id != $error_item_id

You need to write them in one line and use OR instead.
User avatar
Moderator

GK User
Mon Dec 14, 2015 2:38 pm
Thanks Cyberek, can you provide an example of how the code should look?

Thanks,
James
User avatar
Junior Boarder

GK User
Wed Dec 16, 2015 6:23 pm
It depends on what you trying to do, maybe:
Code: Select all
($this->API->modules('header') && $item_id != $error_item_id) || ($this->API->modules('header_search') && $item_id != $error_item_id) || (if($this->API->modules('header_content') && $item_id != $error_item_id)

will work.
User avatar
Moderator

GK User
Thu Dec 17, 2015 2:52 pm
Thanks again!

I tried to get this to work but still encountered some issues and I don't quite understand the logic in the code. What I decided to do is create a clone template of quark.

Essentially what I have now is (2) quark templates installed.
1. Home Page - Template
2. Other Page - Template

I like this approach even more because it offers me the ability to have multiple override.css files and more control of my styling.
User avatar
Junior Boarder

GK User
Mon Dec 21, 2015 12:29 pm
So basically the problem is solved?
User avatar
Moderator

GK User
Mon Dec 21, 2015 2:19 pm
I suppose, I didn't resolve the original issue I just worked around it.
User avatar
Junior Boarder

GK User
Wed Dec 23, 2015 9:12 pm
Ok, I think there is no point changing something if it works ;).
User avatar
Moderator


cron