Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Make a module appear if a the template height reach certain dimensions

Make a module appear if a the template height reach certain dimensions

Hi Stephen, I got an unusual one for you, I hope you will like it! smile

Joomla template are as you know vertically fluid to acquaint the length of a full text article. Therefore, Right and Left template position are often empty because the module that are permanently there are part of the design within certain proportions.

What is awkward is when the articles are longer and the right or left position leave useless blank spot without any content.

Would it be position to make one or many "backup modules" to fill those gaps by checking height dimensions interval like for example:

Code:


if ( template height --> 1501px-2000px ) return "999";
if ( template height --> 2001px-2500px ) return "999, 1000";
if ( template height --> 2001px-2500px ) return "999, 1000, 1001";
etc.

Cheers,
Alex

atherrien
Modder Extraordinaire
ranks
useravatar
Offline
140 Posts
Administrator has disabled public posting

Re: Make a module appear if a the template height reach certain dimensions

Hi Alex,

Technically, this very hard to achieve because a module would not have any access to information about the pixel height of any part of the page until the page is actually rendered (i.e. generated, then sent to the browser). At that point it's possible to calculate the height of page of the page using Javascript, but by then it's too late to use this information to add more modules.

There are lots of other similar things that I've been asked, but that have the same problem:

- window size
- screen resolution
- net speed

... these can all be calculated client-side with Javascript, but by the time you've calculated this, you would have to send it back to the server, use this to recalculate the page, then refresh the page. It's all a bit too complicated.


Sorry,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3319 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1674
Total Polls:
6
Total Posts:
5917
Total Posts Today:
5
User Info:
 
Total Users:
11536
Newest User:
lucero1247
Members Online:
4
Guests Online:
150


Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked