• Resolved mrshoub

    (@mrshoub)


    I would like to be able either to:

    • Modify the class-library-viewer-shortcode.php file or
    • Create a new php file to place in the mu-plugins directory.

    I am just not quite sure what the php code should be to reference and activate the the lv_file_icon_html hook filter.

    Hope you can help.
    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Pexle Chris

    (@pexlechris)

    The easy way is to do it with css:

    .library-viewer--file__icon.library-viewer--gif__icon,
    .library-viewer--file__icon.library-viewer--jpg__icon,
    .library-viewer--file__icon.library-viewer--png__icon{
       width: 10px;
       height: 10px;
       background-image: url("the_url_of_img_icon");
    }

    You can replace the png or jpg for example with the file extension of your choice.

    or you can use the filter lv_file_icon_html?in order to replace the icon html with the html(img) of your choice.

    Hope to help you ??

    Thread Starter mrshoub

    (@mrshoub)

    In which css file should I add this class? I have tried adding this to the assets/folders.css but the file icons did not appear.

    Your help is really appreciated. Thanks.

    Plugin Author Pexle Chris

    (@pexlechris)

    You can add your css in

    Themes > Customize > Additional CSS

    Thread Starter mrshoub

    (@mrshoub)

    Sorry to be such a nuisance, but I cannot get the file icon to show beside the file.

    This is the shortcodes I have, and these seem to work.

    [library-viewer have_file_access=”all” my_doc_viewer=”library-viewer”]

    This is the css I added to the Themes -> Customize -> Additional CSS

    .library-viewer–file__icon.library-viewer–gif__icon,
    .library-viewer–file__icon.library-viewer–jpg__icon,
    .library-viewer–file__icon.library-viewer–png__icon{
    ??width: 10px;
    ??height: 10px;
    ??background-image: url(“https://citizen.on.ca//wp-content/plugins/library-viewer/assets/file-icon.png”); }

    The website is?citizen.on.ca?and on the menu bar at the top, if you click Our Papers -> Archived, it will take you to the page where I want ta pdf image icon to appear beside the file.

    Again thanks, and I hope I am not driving you too crazy.

    Thread Starter mrshoub

    (@mrshoub)

    .

    In my last message there was a typo.

    In the website backend the background-image line in the Advanced CSS appears as:

    background-image: url(“https://citizen.on.ca//wp-content/plugins/library-viewer/assets/file-icon.png”); }

    Plugin Author Pexle Chris

    (@pexlechris)

    you need to change the extension. png are for images…

    .library-viewer--file__icon.library-viewer--pdf__icon{
       width: 10px;
       height: 10px;
       background-image: url("https://citizen.on.ca/wp-content/plugins/library-viewer/assets/file-icon.png");
    }

    If you need more help you can hire a developer or to ask GPT chat

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘File Icons’ is closed to new replies.