Search code examples
pdfthemesmoodlefavicon

PDF favicon different to website's theme favicon


I am using moodle (open source LMS) and create different themes for clients. I have a link that opens a FAQ pdf document in another tab. The problem is that the pdf document's favicon is different from the theme's favicon. The pdf is stored in the theme's folder, but obviously doesn't reference a layout or anything.

The favicon that shows for the pdf isn't even used in another theme. Is it possible that the pdf itself has a favicon attached to it? And how would I change it? I've googled and no one else seems to have had this specific problem.


Solution

  • I managed to solve it by creating a new page in the theme and added the link to the correct favicon and embedded the pdf document.

        <head>
        <title>FAQ</title>
        <link rel="shortcut icon" type="image/x-icon" href="http://www.example.com/theme/themename/pix/favicon.ico">
    </head>
    
    
    <body marginwidth="0" marginheight="0" style="background-color: rgb(38,38,38)">
        <embed width="100%" height="100%" name="plugin" src="<?php echo $CFG->wwwroot."/theme/themename/FAQ/FAQ_Document.pdf"; ?>" type="application/pdf">
    </body>
    

    Still no idea how the pdf had it's own default favicon though.