Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • borisgoodenough Friend
    #119414

    Is there a way to remove CSS control over {mosimage} borders so they can be controlled by the MOSimage control panel?

    I’m developing a site with the Wistery template, and want to put borders around some (but not all) the images inserted in content items with {mosimage}.

    Using the {mosimage} border control had no effect at all, so I went into the CSS and inserted the line “border: 1px solid #999999;” under .mosimage img. But this puts a border around EVERY {mosimage} insertion, whether it’s wanted or not.

    Thanks!

    I tried

    itguy Friend
    #216715

    I just installed Wistery and the file level control using the mosimsge panel works fine. I took a look at the mambots/content/mosimage.php and it appears (if I am reading it correctly) that the values are pulled from the database (these are the values you enter in the mosimage control panel) and then when the img tag is assembled it gets assigned the div mosimage tag for the css.

    So if you have any of the variables defined in the css they are going to overwrite the ones form the database that you assigned using the mosimage control panel. Open the template-css file for Wistery and find line 1255. Make sure you do not have the border or any other parameters defined and it should work on a “per-image” basis.

    Here is what my css file has for mosimage:


    .mosimage {

    padding: 0;

    margin: 5px 15px 0 0!important;

    margin: 5px 5px 0 0;

    }

    .mosimage img {

    padding: 0;

    margin: 0!important;

    }

    .mosimage_caption {

    margin-top: 5px;

    padding: 1px 2px;

    color: #999999;

    }

    Please post the code from your file.

    borisgoodenough Friend
    #216716

    My code for these lines is identical to what you posted, which is the template default. That’s why I’m puzzled.

    The border control seems to be the only part of {mosimage} that isn’t working properly. Is there any other place in the CSS that could be controlling this?

    <em>@itguy 11100 wrote:</em><blockquote>I just installed Wistery and the file level control using the mosimsge panel works fine. I took a look at the mambots/content/mosimage.php and it appears (if I am reading it correctly) that the values are pulled from the database (these are the values you enter in the mosimage control panel) and then when the img tag is assembled it gets assigned the div mosimage tag for the css.

    So if you have any of the variables defined in the css they are going to overwrite the ones form the database that you assigned using the mosimage control panel. Open the template-css file for Wistery and find line 1255. Make sure you do not have the border or any other parameters defined and it should work on a “per-image” basis.

    Here is what my css file has for mosimage:


    .mosimage {

    padding: 0;

    margin: 5px 15px 0 0!important;

    margin: 5px 5px 0 0;

    }

    .mosimage img {

    padding: 0;

    margin: 0!important;

    }

    .mosimage_caption {

    margin-top: 5px;

    padding: 1px 2px;

    color: #999999;

    }

    Please post the code from your file.</blockquote>

    itguy Friend
    #216717

    To my knowledge, no. If you are using an editor with search functionality like Dreamweaver, try searching the css file and then the entire site for the value mosimage and see what comes up.

    Very odd. Sorry I wasn’t more help on this one. At least I can confirm for you that a raw install is working fine on my end. What version of Joomla are you using? 1.0.12?

    itguy Friend
    #216719

    Just thought of something… maybe you have a border defined for the img tag itself in css. Take a look at lines 299, 977, 1267, 1583, 1769, 2269. I just searched for any img in the css.

    Here is my code:

    a img {

    border: none;

    }

    table.pollstableborder img {

    vertical-align: baseline;

    }

    .mosimage img {

    padding: 0;

    margin: 0!important;

    }

    #ja-header h1 img {

    float: left;

    }

    #ja-usertools img {

    padding: 0 2px;

    margin: 0;

    }

    #ja-pathway img {

    margin: 0 5px 1px;

    }

    borisgoodenough Friend
    #216721

    Nope, all of those lines are exactly the same.

    This may be a clue: I opened the mosimage.php file to the following:

    // $attrib[3] border
    if ( !isset($attrib[3]) || !$attrib[3] ) {
    $attrib[3] = 0;
    }

    // $attrib[4] caption
    if ( !isset($attrib[4]) || !$attrib[4] ) {
    $attrib[4] = '';
    $border = $attrib[3];
    } else {
    $border = 0;

    Changing the $border in the last line to 1 puts a 1px border around all the mosimage pictures. That makes me think the problem is with mosimage not setting $attrib[3] for the individual images, and simply picking up whatever value the default border is set to — normally 0.

    Any ideas where to go from here?

    itguy Friend
    #216723

    My code is the same in mosimage.php


    // $attrib[3] border
    if ( !isset($attrib[3]) || !$attrib[3] ) {
    $attrib[3] = 0;
    }

    // $attrib[4] caption
    if ( !isset($attrib[4]) || !$attrib[4] ) {
    $attrib[4] = '';
    $border = $attrib[3];
    } else {
    $border = 0;
    }

    What it is saying is if a border is not set then set it to 0. You should already have attrib[3] if that value is set for the image. I’m going to take a look at my database table and see where the mosimage values are set. Will post back. Maybe the problem lies in the query to set the values in the database. That would explain why the values are pulled form css.

    borisgoodenough Friend
    #216725

    Just checked my database — the value is set to “1” for the photos in question.

    This doesn’t seem to be template-related; I just tried a non-JA template and got the same non-border.

    So mosimage is not pulling that value, but is supplying the default from mosimage.php instead. Maybe I’ll try asking this over on the Joomla forums.

    itguy Friend
    #216735

    If you view the source for the page that has the image in question, is the css class mosimage assigned to the img tag? I just looked at mine and no css is assigned to the tag. It’s just inheriting from contentpaneopen.

    I just googled this and only found one post that may not be relevant.

    http://www.joomlashack.com/component/option,com_smf/Itemid,146/topic,3140.0/prev_next,next

    They say in the post that if you include a caption then everything works. Can you check that on your end? This still does not explain why it works here and not for you.

    By the way, what version of Joomla are you running and what browser?

Viewing 9 posts - 1 through 9 (of 9 total)

This topic contains 9 replies, has 2 voices, and was last updated by  itguy 17 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum