Jump to content

Jos

New Members
  • Posts

    3
  • Joined

  • Last visited

Jos's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, I'm working my rear end off to get somewhat acquainted with php, this really helps a lot. I'm gonna try it out. If it doesn't work, I'll get back to you.
  2. countModules is a Joomla internal function. I don't know (yet) what an input is. I'm more into templating and general html rather than php, but working on it. Where do I set the variables? In the top of the template, before the variables are called? Or when required, just above the Joomla countmodules? When I echo a variable, to see if it works it echos the value I assigned to it, not what it should be. I set the variables above the code: $left=0 Then the Joomla code: <?php if ($this->countModules ('left')) : ?> <div id="left" class="four columns"> <jdoc:include type="modules" name="left" style="xhtml" /> </div> <?php endif; ?> <?php echo $left; ?> It should give me the value of $left - but it doesn't. It shows me the value I gave it. It should be one (the module is present), it gives me 0.
  3. Hi, I'm completely new to coding in php. I'm stuck with this: For a Joomla template I need to set up variables, using countModules. This is what I try to do, but I am getting nowhere: I want to create a three column template, based on the Skeleton CSS Framework. <div id="left" class="four columns"> <-- left sidebar <div id="main" class="eight columns"> <-- Joomla component <div id="right class="four columns"> <-- right sidebar That's the basic template, with all three columns present. If one sidebar is missing, then "main" has to change from class="eight columns" into class="twelve columns". If both sidebars are missing, "main" has to change to class="sixteen columns". I understand I have to set up variables first. I give them the value 0. $left = 0, $right = 0, $main = 0 + ($left + $right) Then I would use countmodules to count the modules, to get a value. Being 0 (no modules) or 1 (modules present). If the total = 0, (no sidebars present) $main would be 0, and that should echo "sixteen" columns. If the total is 1, (1 sidebar present) $main would be 1, giving echo "twelve" columns If the total is 2, (2 sidebars present) $main would be 2, giving echo "eight" columns. That's roughly how it should be, I think. But it doesn't work. Can anyone help me to get this working correctly? Thanks, Jos
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.