SimplePortal
Customization => Blocks and Modifications => Mod Requests => Topic started by: guiller_mote on June 27, 2018, 07:48:02 AM
-
Hi all, I hope some body can hel me.
Is there any posibility to choose if a block is displayed only for mobile or desktop? I know I saw that in some other portal, I don't remember sorry, but I believe it is a very good functionality.
Some body can tell me if there is any mod for this?
Thanks in advanced.
Regards.
-
Hello, have a look at this: https://simpleportal.net/index.php?topic=13954.msg69201#msg69201 :)
-
Thanks so much for your quick answer. I will try to implement that but probably I will back to you because I am not an expert, sorry :(
-
I knew I would have to back :(.
I don't know how to put the code:
#sp_block_ID
{ display: none;}
@media only screen and (max-width: 750px), only screen and (min-resolution: 300dpi) {
#sp_block_X {
css properties here;
}
}
I suppose is in default/css/portal.css but how I know the ID of the block? what I have to put in css properties?
-
Can anybody help me on how use that code exactly?
-
You can see the ID of the block whenever you edit it, in the URL.
The code has to be added in /whateverthemefolderyouareusing/css/index.css at the end of the file.
And sorry for the delay I completely forgot :/
-
Don't worry Ninja, thanks for your answer.
I could do it adding the code in /themes/default/css/portal.css.
I added at the end the folowing code:
#sp_block_ID
{ display: none;}
@media only screen and (max-width: 750px), only screen and (min-resolution: 300dpi) {
#sp_block_1 {
display: none;
}
}
And the block 1 disapear but only the body, the title still continue showing. There is some css code tu remove it and don't show any part of the box?
In the most cases it works for me as I wanted to remove some publicity blocks that I have them without title but with this functionality now I wolud like to remove also some standard blocks like statistics or so :)
Thanks again for your help.
-
And the block 1 disapear but only the body, the title still continue showing. There is some css code tu remove it and don't show any part of the box?
In the most cases it works for me as I wanted to remove some publicity blocks that I have them without title but with this functionality now I wolud like to remove also some standard blocks like statistics or so :)
Thanks again for your help.
Some body could help me with this? I would like to hide some blocks that I have with title and I don't be able to hide it too.
Thanks.
-
You have a few options.
If it is only HTML or PHP blocks you are concerned about then you can set the block settings to no body & no title then use something like this:
HTML example:
<div class="cat_bar">
<h3 class="catbg">
BLOCK TITLE GOES HERE
</h3>
</div>
<div class="windowbg">
BLOCK BODY GOES HERE
</div>
Otherwise perhaps you will have to surround the entire block coding with your HTML condition in ./Themes/default/Portal.template.php
Look at the template_block_default template & echo your condition at the start of the function & close the condition tag at the end of the function.
Portal pages use a different template located in ./Themes/default/PortalPages.template.php
You will have to apply the same sort of thing in that file for pages.