Keyword

Div Settings with loadModule

  • troponin
  • troponin's Avatar Topic Author
  • Offline
  • Platinum Member
More
14 years 10 months ago #77658 by troponin
Div Settings with loadModule was created by troponin
Hey folks,i am working on my custom template and I have a question for the div settings of the load module position.I set a module position in a seperated div next to the div.itemList in item.php. I placed them by using float:left for both. I had to set the width for both divs to place them correctly. Now, if I have a Menu Link where the modules aren't activated it is clear that the width is still there (but empty). How can I solve it that div.itemList use full width if module position is empty and use the width -modulePosition-Width if Modules are activated ?Here is a linkthx

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #77659 by Simon Wells
Replied by Simon Wells on topic Div Settings with loadModule
I saw you tweet, will have a look when I get home in a couple of hours.

Please Log in or Create an account to join the conversation.

  • troponin
  • troponin's Avatar Topic Author
  • Offline
  • Platinum Member
More
14 years 10 months ago #77660 by troponin
Replied by troponin on topic Div Settings with loadModule
I'll be waiting ;)

Please Log in or Create an account to join the conversation.

More
14 years 10 months ago #77661 by Simon Wells
Replied by Simon Wells on topic Div Settings with loadModule
Ummm, having troubles with it.

Can you send a snippet of the CSS you are using?

Troponin said:I'll be waiting ;)

Please Log in or Create an account to join the conversation.

  • troponin
  • troponin's Avatar Topic Author
  • Offline
  • Platinum Member
More
14 years 10 months ago #77662 by troponin
Replied by troponin on topic Div Settings with loadModule
Here are the Code Snippets:

Css Definition to set the two divs next to each other

div.itemList {float:left;width:520px;}
div.k2content_right {float:right;width:260px;}


Content of the content.php to set the Module Position for Content Modules right:





If there are Modules Activated all seems okay. I know if the Modules are deactivated that the css declaration for div.itemList {float:left;width:520px;} is still working.

My Question is : How can I place it dynamic ?

If Modules are active use the CSS seen on top.
If Modules are deactivated use Full Width of div.itemList and hide div.k2content_right

I tried the things I know but it seems to be to less :(

Please Log in or Create an account to join the conversation.

  • BNR Investment Group
  • BNR Investment Group's Avatar
  • Offline
  • Senior Member
More
14 years 8 months ago #77663 by BNR Investment Group
Replied by BNR Investment Group on topic Div Settings with loadModule
Typically when you are dealing with module positions that you want to collapse when they are empty you the built in countModule function in a conditional statement to make the div disappear if no modules are being loaded in to that position. There is no way to post code here so I attached a text file with a sample.
Attachments:

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum