Jump to content

Improvement to the logo JSON schema markup


Gabriel Torres

Recommended Posts

Hello,

This suggestion is regarding the logo schema markup that is added at the bottom of every page.

Currently, the logo that is used is the theme's main logo. There are two issues with that, in my opinion:

1. The main logo is rectangular, whereas the logo provided by the schema markup should be squared;

2. The main logo changes with the theme. For instance, we have two themes here, a light one and a dark one, and in the dark theme, the logo has a dark backgound and different colors. This way, the logo will change depeding on the theme that is being used. If the dark theme is crawlable by Google, Google may display a different logo than intended in results.

Therefore, I think it would be better if the logo in the JSON schema markup is (1) squared and (2) fixed (not changing depending on the theme).

So, my proposal is to change the system/Output/Output.php file, from:

if( $logo = \IPS\Theme::i()->logo_front )
                {
                        $jsonLd['organization']['logo'] = array(
                                '@type' => 'ImageObject',
                    			'@id'   => \IPS\Settings::i()->base_url . '#logo',
                    			'url'   => (string) $logo
                        );
                }

To:

if( $logo = json_decode( \IPS\Settings::i()->icons_homescreen, TRUE ) )
                {
                        $jsonLd['organization']['logo'] = array(
                                '@type' => 'ImageObject',
                    			'@id'   => \IPS\Settings::i()->base_url . '#logo',
                    			'url'   => \IPS\Settings::i()->base_url . 'uploads/' . $logo['original']
                        );
                }

Here I used the "homescreen" logo present in the Icons & logos page from the ACP because it fits the criteria I want (squared and fixed), but you may want to create a new setting for this specific logo.

I hope you can improve this.

Cheers!

Edited by Gabriel Torres
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...