-
AuthorPosts
-
activha Friend
activha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
January 11, 2013 at 4:23 pm #183871I have noticed that you have moved content size to css only with new version 1.0.7 so if I set a width for a component in index.php it is not correctly set for small devices.
How can I set a width 50% for a component only which keeps everything ok for all devices screen ?
earlier I would have written in index.php
[PHP]<div id=”content” <?php if ( JRequest::getCmd( ‘option’ ) == ‘com_jek2story’ ){ echo ‘style=”width: 50% !important;”‘ ;} ?>>
[/PHP]
and
[PHP]<div id=”aside” <?php if ( JRequest::getCmd( ‘option’ ) == ‘com_jek2story’ ){ echo ‘style=”width: 50% !important;”‘ ;} ?>>
[/PHP]But this does not work any longer for small screen devices, I end up with half of screen on iphones and iPads
Thanks for the clue
Wall Crasher DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
January 14, 2013 at 6:44 am #479569Hi activha,
If you want to set the css width, you can do it in file /templates/ja_wall/css/layout-normal.css line 24
body.has-aside #content {
width: 70%;
}/* Aside —*/
#aside {
width: 30%;
}You can also use the code above, but please remove !important rule.
Hope it helps.
Regards
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
January 15, 2013 at 8:43 am #479803No the question was :
how to set width for a component only ?is it feasible by css only ?
Wall Crasher DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
January 16, 2013 at 3:02 am #479932Hi activha,
<blockquote>You can also use the code above, but please remove !important rule.</blockquote>
Did you try this?
Regards
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
January 16, 2013 at 5:13 pm #480054Well we solved it another way from within the component.
Thanks for your time anyway
I have noticed that with K2 blogs were now at full wdth compared with old version 1.0.6 where they were at only 70% of the width
Is it also in layout css or in k2 ?
Wall Crasher DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
January 17, 2013 at 2:25 am #480086Hi activha,
We add a check that if there was no module on the right, the content will be 100%.
I do not know whether you are in this case or not.Those CSS was defined in CSS file.
Regards
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
January 17, 2013 at 11:29 am #480184Yes and how can I remove this check for chosen components only ?
Wall Crasher DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
January 18, 2013 at 2:33 am #480258Hi activha,
For the latest version you will see this block code in templatesja_wallindex.php
<?php if (WallHelper::hasAside()): ?>
If you want to add a check for you component, for Ex
if ( JRequest::getCmd( 'option' ) == 'com_jek2story') { .. }
Just put theme together
<?php if (WallHelper::hasAside() ('AND' OR 'OR' OPERATOR HERE) ( JRequest::getCmd( 'option' ) == 'com_jek2story')) : ?>
I do not really understand what you really want here.
For original question, just echo like this
echo ‘style=”width: 50%;”‘If it is difficult for your, then you can hire a developer that will get the job done in several hours.
Regards
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
January 20, 2013 at 12:08 pm #480489Well this code will change all layouts including mobile layouts.
what I want is only revert back to a default width of 70% for content layouts without aside module on components such as K2 and CB.
Width for iframes and grid can be set to 100% but 100% on components without aside modules is not looking good.
Basically then I need to put a condition on the layout css for some components only on the #content tag, but I dont know how.
On ja Wall prior to 1.0.6 it was easy to do in index.php but as you moved everything to css I dont’ really see how to do it as #content defaults to width 100%
Wall Crasher DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
January 21, 2013 at 2:37 am #480507Hi activha,
Well this code will change all layouts including mobile layouts.
Since the mobile css use !important rule, so you can use { echo ‘style=”width: 50%;”‘ ;} ?>>This will make the mobile layout always 100% full-width.
Please try with this and let me see the result also.
Regards
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
January 21, 2013 at 1:43 pm #480637Well it works for mobile but then it destroys extra-wide layout which needs 50 % !
This was much easier with 1.0.6 🙁
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
January 21, 2013 at 2:34 pm #480641I tried in index.php
[PHP]
<!– MAIN CONTENT –><?php if ( JRequest::getCmd( ‘option’ ) == ‘com_comprofiler’ || JRequest::getCmd( ‘option’ ) == ‘com_k2’ || JRequest::getCmd( ‘option’ ) == ‘com_uddeim’){ echo ‘<STYLE type=”text/css”>@media only screen and (max-width: 1585px) { div#content{width:60%;} </STYLE> <STYLE type=”text/css”>@media only screen and (min-width: 1586px) { div#content{width:50%;}}</STYLE>’; } ?>
<div id=”content”>[/PHP]
This seems to work for screens under 1586 px but does not work above?
If you have a better idea or can correct this, I’ll take it 🙂
Wall Crasher DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
January 22, 2013 at 6:22 am #480711Hi activha,
Have you tried to add !important to the media screen width > 1586px yet ?
Like this<!– MAIN CONTENT –>
<?php if ( JRequest::getCmd( 'option' ) == 'com_comprofiler' || JRequest::getCmd( 'option' ) == 'com_k2' || JRequest::getCmd( 'option' ) == 'com_uddeim'){ echo '<STYLE type="text/css">@media only screen and (max-width: 1585px) { div#content{width:60%;} </STYLE> <STYLE type="text/css">@media only screen and (min-width: 1586px) { div#content{width:50% !important;}}</STYLE>'; } ?>
<div id="content">
Please try and tell me the result.
Regards
activha Friendactivha
- Join date:
- July 2012
- Posts:
- 114
- Downloads:
- 17
- Uploads:
- 6
- Thanks:
- 5
- Thanked:
- 1 times in 1 posts
January 24, 2013 at 6:59 pm #481060Well I did it this way :
<?php if ( JRequest::getCmd( 'option' ) == 'com_comprofiler' || JRequest::getCmd( 'option' ) == 'com_k2' || JRequest::getCmd( 'option' ) == 'com_uddeim' ) { echo '<STYLE type="text/css">@media only screen and (min-width:720px) and (max-width: 1585px) { div#content{width:60%;} </STYLE> <STYLE type="text/css">@media only screen and (min-width: 1586px) { div#content{width:50%;}}</STYLE>'; } ?>
Is that correct ? or can you better it ?
Wall Crasher DeveloperWall Crasher
- Join date:
- December 2011
- Posts:
- 1113
- Downloads:
- 0
- Uploads:
- 15
- Thanks:
- 66
- Thanked:
- 361 times in 300 posts
January 25, 2013 at 1:49 am #481072Yes, you can try it.
-
AuthorPosts
This topic contains 15 replies, has 2 voices, and was last updated by Wall Crasher 11 years, 10 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum