Forum Support

Shape 5
March 29, 2024, 12:10:51 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Shape 5 Forum
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: HTML not generating correctly when no left and right modules displayed  (Read 634 times)
barsik01
Jr. Member
**
Offline Offline

Posts: 5



« on: October 01, 2009, 06:10:25 PM »

In my website there are a couple of pages that display at full width without modules placed on the left or the right.  In those instances, the HTML generated for the page creates a tag and drops off in the middle before completing:

<div id="s5_mainbackmiddle">
<div style="
<div id="s5_maincolumn" style="width:888px;float:left;">

As a results I'm seeing some strange behavior:

http://lts-allies.org/index.php/forums

The relevant code appears to start around line 306-307 in the index.php file, but I don't speak PHP   Cheesy

Thanks.
Logged
barsik01
Jr. Member
**
Offline Offline

Posts: 5



« Reply #1 on: October 01, 2009, 06:36:54 PM »

Followup:  I was able to add a </div> tag to the inserted center module in the page I sent (http://lts-allies.org/index.php/forums) so that the visual is fixed.  But the incomplete div tag after s5_mainbackmiddle is still in the HTML.

Thanks!
Logged
jonahh
Administrator
*****
Offline Offline

Posts: 23789



WWW
« Reply #2 on: October 01, 2009, 07:10:32 PM »

Where do you see the extra DIV, just in the php file?  Have you tried just removing it?
Logged

Jonah Hall
------------
Shape 5 Team

- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
barsik01
Jr. Member
**
Offline Offline

Posts: 5



« Reply #3 on: October 01, 2009, 07:24:01 PM »

It's here (lines 306-311 in index.php):

                     <div style="
                     <?php if ($this->countModules("left") && !$this->countModules("right")) { ?>margin-left:<?php echo $left_margin; ?>px;"><?php } ?>
               
                     <?php if (!$this->countModules("left") && $this->countModules("right")) { ?>margin-right:<?php echo $right_margin; ?>px;"><?php } ?>

                     <?php if ($this->countModules("left") && $this->countModules("right")) { ?>margin-right:<?php echo $right_margin; ?>px;margin-left:<?php echo $left_margin; ?>px;"><?php } ?>

And it produces the following code:

                     <div style="
                                    
                     
                                    <div id="s5_maincolumn" style="width:888px;float:left;">

The DIV tag however renders properly if either a left or right module is on in a page, so I don't know that it should be removed?

Logged
jonahh
Administrator
*****
Offline Offline

Posts: 23789



WWW
« Reply #4 on: October 05, 2009, 02:46:22 PM »

Try changing it to the following, I've added a fourth line if no left or right modules are published:

<div style="
                     <?php if ($this->countModules("left") && !$this->countModules("right")) { ?>margin-left:<?php echo $left_margin; ?>px;"><?php } ?>
               
                <?php if (!$this->countModules("left") && !$this->countModules("right")) { ?>margin-left:<?php echo $left_margin; ?>px;"><?php } ?>
               
                     <?php if (!$this->countModules("left") && $this->countModules("right")) { ?>margin-right:<?php echo $right_margin; ?>px;"><?php } ?>

                     <?php if ($this->countModules("left") && $this->countModules("right")) { ?>margin-right:<?php echo $right_margin; ?>px;margin-left:<?php echo $left_margin; ?>px;"><?php } ?>
Logged

Jonah Hall
------------
Shape 5 Team

- Need a great host for your website? We highly recommend siteground.com!


- Put your trust in the hands of our extremely qualified staff to get your job done right!


- Firebug is the most powerful web development and debugging tool, and it will save you a lot of time, frustration and forum questions:
Install Firebug
barsik01
Jr. Member
**
Offline Offline

Posts: 5



« Reply #5 on: October 05, 2009, 08:32:23 PM »

Thanks, Jonah.

Unfortunately it did not work. I'm attaching a screenshot of a page that includes no left/right modules.  If it would help, I can PM you login credentials to take a look.

Bryce
Logged
barsik01
Jr. Member
**
Offline Offline

Posts: 5



« Reply #6 on: October 06, 2009, 08:12:59 PM »

This is what I did...
I changed your code to read:
<div style="
                     <?php if ($this->countModules("left") && !$this->countModules("right")) { ?>margin-left:<?php echo $left_margin; ?>px;"><?php } ?>
               
                     <?php if (!$this->countModules("left") && !$this->countModules("right")) { ?>margin-left:0px;"><?php } ?>
               
                     <?php if (!$this->countModules("left") && $this->countModules("right")) { ?>margin-right:<?php echo $right_margin; ?>px;"><?php } ?>

                     <?php if ($this->countModules("left") && $this->countModules("right")) { ?>margin-right:<?php echo $right_margin; ?>px;margin-left:<?php echo $left_margin; ?>px;"><?php } ?>


Then, just before the <div id="s5_mainbottomback"></div> I added this code to close off the DIV tag that was left open:

                     <?php if (!$this->countModules("left") && !$this->countModules("right")) { ?></div><?php } ?>

It appears to be working...   Smiley
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Looking for the largest variety in template designs? Look no more. Never buy 1 theme again. Signups start at just $89 for access to all of our themes.
Send Us An Email
Please send us your questions and we will email you back as soon as we can. Product support questions should be posted in our support forums under the Help menu. Our staff will assist you from there.