a simple piece code , i am sure

Discussion in 'PHP' started by mnymkr, May 21, 2006.

  1. #1
    can someone help me right a simple piece of code. i am using joomla and i have two modules position that can be at the top of my page. if only one is publised I would like for my table to be centered and 100%. if both are published I would like for it the be centered and 50% each.

    i would also like to understand what is going on somewhat. thanks!
     
    mnymkr, May 21, 2006 IP
  2. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think you need to set this up in your site template. In the template, you can get the number of modules that are going to be placed in to the location and then you can do whatever you like with them (eg. change the layout somewhat).
     
    TwistMyArm, May 21, 2006 IP
  3. mnymkr

    mnymkr Well-Known Member

    Messages:
    2,328
    Likes Received:
    32
    Best Answers:
    0
    Trophy Points:
    120
    #3
    yes i can set it up in my template. what i want to do is write a little piece of code that will split the table if both modules are loaded.
     
    mnymkr, May 21, 2006 IP
  4. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #4
    OK, I was actually thinking that you were able to load each module one by one in the template, but that looks a little messy.

    For the time being, assuming the position you want to change is called 'top', what happens if you replace:
    mosLoadModules( 'top' );

    with:
    mosLoadModules ( 'top', 1 );

    Apparently, the '1' parameter sets the 'horizontal' style for the position.

    Hopefully this is 'good enough'... in theory, it should do exactly what you want it to...
     
    TwistMyArm, May 22, 2006 IP