I have a custom template that I am using in my website. To the right of my pages I have a position with a background color that I do not want to display on my terms of use page. The position contains a twitter module which I can remove from the page but I am still left with a small box containing the background color from the css. Can I completely remove this position from just the terms of use page.
Asked
Active
Viewed 620 times
1
-
Yes, where is your page at? – m4n0 Sep 22 '15 at 17:41
-
for example http://www.alanmccarthy.com/ this is the home page and here is the terms page http://www.alanmccarthy.com/terms-of-use as you can see the grey box still appears even though it contains nothing – Alan Mc Sep 22 '15 at 17:43
-
Can you modify your HTML? – m4n0 Sep 22 '15 at 17:48
-
yes i can modify the html – Alan Mc Sep 22 '15 at 17:55
-
So the problem is the background color is associated with the position right? I would say why don't you count have many modules will be displayed and then condition the background class based on that. – Elin Sep 24 '15 at 16:47
2 Answers
1
In your Terms of use page, add a custom class say terms-of-use
and then override it with background: transparent
The dynamic custom class can be generated through Adding custom class on Joomla pages
CSS
body.terms-of-use .social {
background: transparent;
}
Output:
-
but this then hides the background on the other pages, for example now it does not display on the home page – Alan Mc Sep 22 '15 at 18:03
-
Try this: http://joomla.stackexchange.com/questions/5398/adding-custom-css-styling-on-some-of-my-pages and check the browser for the generated page id for Terms of use page. – m4n0 Sep 22 '15 at 18:08
-
that seems like it should be working is the correct syntax for the css .pageid113.social{ } or do I need to be more specific with the name – Alan Mc Sep 22 '15 at 18:31
-
I have updated my code. `.pageid11.social` will not work since it is a multiple class selector. Currently your pages generated dynamic classes with a name. So use `.terms-of-use` – m4n0 Sep 22 '15 at 18:41
0
You can edit the html template, look for the place where the module is shown in the index.php will be like this ...
<jdoc:include type="modules" name="social" style="none" />
And add some code in PHP, so that only the module is displayed, when the module is published. In this way joomla will not write anything if there is no content to show and will not need to do anything in the CSS, besides improving the loading of the page.
<?php if($this->countModules('social')) : ?>
<jdoc:include type="modules" name="social" style="none" />
<?php endif; ?>

Jose Luis Algara
- 175
- 4
- 15