klox7 VIP
Total posts: 914
28 Dec 2013 12:22

I would like to add some custom icons for field label. I noticed that path to icon folder is in media/mint/16. Can I put custom images in here or will they be deleted once I update to new versions of Cobalt? Is it possible to create folder media/mint/32 and use this folder as main folder for field label or is there another more bullet proof way?

Last Modified: 02 Mar 2014


pepperstreet VIP
Total posts: 3,837
30 Dec 2013 00:15

Good point!

I remember my older ME Resources topic about custom icons and location etc. ...

Maybe Cobalt should allow to point to a different custom icon folder. A manual replacement of the default icons is not very smart and save, IMHO.

Custom lable icons:

Most likely a task for the field parameter: LABEL CLASS

Enter your custom CSS class and set an image and respective CSS styles.

In addition to your custom class, there is always an ID for the label. It is created from the field ID "#" a minus "-" and the three characters "lbl" i.e.:

HEADS-UP:

I found an issue/bug. The custom label class is NOT in page source output!?! I checked with default templates. I think this bug was mentioned earlier and some time ago. Did it re-occur?


klox7 VIP
Total posts: 914
30 Dec 2013 04:14

I agree, if you could be able to choose custom icon folder that would be great. But I like the workaround also:).

Regarding label class...I can confirm that label class with default template dosn't show in output. That's because there is no string to echo label class.

I think that instead of

it should be

label id="<?php echo $field->id;?>-lbl" class="params->get('core.lable_class'));?>">

For custom template where I output fields based on ID I use

fields_by_id[ID]->params->get('core.lable_class');?>

stblink VIP
Total posts: 501
02 Jan 2014 08:41

Hey Klox,

Don't want in anyway to interfer with your ideas, but why don't u use fontawesome icons? I mean, icons usually use color that interfer with the template. Although fontawesome icons can be applied colors.

There is only one issue, regarding the updates... since the html code has to be changed.

Actually i only tested the fontawesome icons with and

  • and both work, but with Cobalt fields none of them are applied but you can test.

    I've done it for CB Registration for example in the screenshot.


    klox7 VIP
    Total posts: 914
    02 Jan 2014 14:19

    Hey stblink,

    thanks for tips but I want to know how to show new or custom icons in field without doing it in html. If cobalt has the option to select icon for filed I would like to do it that way. Fontawesome are great but I need more specifc icons for travel.


    stblink VIP
    Total posts: 501
    03 Jan 2014 09:31

    I see. Well, as far as i know the mediapack file is the one cointaining the icons and if i recall once, i changed the icons from cobalt and gave it the same name.

    When updated the mediapack the icons were replaced by the Mintjoomla icons, but i had backup so i replaced them again. If you are overwriting the icons then you should be carefull installing the mediapack.zip.

    If you save icons with different names, i believe there's no problem because for what i've seen, mediapack does not delete upon updating, just overwrites and inserts new icons if that's the case, anyway just to be sure it's a matter of waiting for an official answer.


    klox7 VIP
    Total posts: 914
    04 Jan 2014 03:25

    If you save icons with different names, i believe there's no problem because for what i've seen, mediapack does not delete upon updating, just overwrites and inserts new icons if that's the case

    Thanks, that's what I needed to know! It's fine for me as long as I don't lose my icons when updating.

    Powered by Cobalt