Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Block: Logo #1851

Closed
mtias opened this issue Jul 11, 2017 · 35 comments
Closed

Add Block: Logo #1851

mtias opened this issue Jul 11, 2017 · 35 comments
Labels
Core REST API Task Task for Core REST API efforts [Feature] Blocks Overall functionality of blocks New Block Suggestion for a new block

Comments

@mtias
Copy link
Member

mtias commented Jul 11, 2017

It'd be nice to have a block that just renders the custom logo as registered with add_theme_support.

@mtias mtias added [Feature] Blocks Overall functionality of blocks New Block Suggestion for a new block Core REST API Task Task for Core REST API efforts labels Jul 11, 2017
@karmatosed karmatosed added the Needs Design Feedback Needs general design feedback. label Jul 11, 2017
@karmatosed
Copy link
Member

karmatosed commented Jul 11, 2017

Here is a suggestion of how that could look design wise. I think it's useful to give option to align and change it right there.

logo

@paaljoachim
Copy link
Contributor

How would we go about adjusting the size of the logo?

@karmatosed
Copy link
Member

karmatosed commented Jul 11, 2017

In this instance, the theme sets the size, I think having it kept to that size makes sense. At least it should be the first version and then perhaps testing will show if it needs to change. This isn't placing an image, it's the site logo.

@westonruter
Copy link
Member

@mtias Note that add_theme_support registers not the custom logo itself, but rather the ability for the user to assign a custom logo in the Customizer. So this is not currently including the ability to change the custom logo as assigned? If not, then this would be directly related to #1224 and being able to source block attributes from global settings.

Also, an endpoint for updating the custom_logo theme mod is currently planned for as part of https://github.com/WP-API/wp-api-customize-endpoints

On the other hand, if the block is just going to be read-only, then really this can be implemented using server-side rendering of a block (#780), re-using a block's PHP rendering logic.

@mtias
Copy link
Member Author

mtias commented Jul 12, 2017

@westonruter we can start with just display, and then add the necessary pieces for updating the data as well. We'll need a coherent system for specifying attributes that map to options, fields, user meta, etc, etc.

@melchoyce
Copy link
Contributor

@karmatosed Rather than showing the logo in the Inspector with instructions for editing, I think we can rely on having an "edit" icon when the block itself is selected, similar to the image block. Like the image block, we might also want to include a link option:

image

@westonruter
Copy link
Member

Should not the block interface actually be identical to the image block in general? The key difference would be in the attribute storage, where the selected image is stored globally in the theme mod as opposed locally in the content. In that way, it should probably get the styling treatment as lifted/external/global blocks: #1516.

@StaggerLeee
Copy link

There is no way Page "template" style and design will match rest of theme, be it custom theme or from repository.
This thing with logo in Posts/Pages is pointless, unless you have plans to go 100% front-end theme editor way, visual theme designer.

@melchoyce melchoyce changed the title Add Logo Block Add Block: Logo Jul 25, 2017
@WPDevHQ
Copy link

WPDevHQ commented Aug 3, 2017

I think this as a block is very fitting for future vision. Maybe these should have been called modules rather than blocks? :P

Some of us theme developers are looking at Gutenberg beyond just a page/post editor - we are looking at the possibility of creating sections/panels for global assignments into places like the header.php, footer.php and even sidebar.php

We are looking at the possibility of pulling in things like the menu, an entire sidebar/widget area and not just an individual widget to build out these global sections/panels - so the blocks that can be brought in by core the better as it will save themes/plugins having to hack them in!

@melchoyce
Copy link
Contributor

Hey @WPDevHQ! That's the long-term goal, just going to take a couple iterations to get there :)

@karmatosed karmatosed self-assigned this Sep 24, 2017
@karmatosed karmatosed added Design and removed Needs Design Feedback Needs general design feedback. labels Sep 24, 2017
@karmatosed
Copy link
Member

As the project moves towards merge proposal, we are moving issues that aren't needed for that to projects. This doesn't mean they won't get done, they totally can and that's why we're moving to projects. This allows us to focus on the issues that have to happen to Gutenberg. I am closing this but it will live in projects.

@karmatosed
Copy link
Member

This is starting to be explored by @pablinos

@karmatosed karmatosed reopened this Nov 13, 2019
@karmatosed karmatosed removed their assignment Nov 13, 2019
@pablinos
Copy link
Member

Thanks @karmatosed! The idea of this block came up during some discussions about full site editing. We were wondering what the future looks like for the logo theme option, and what would make this different from some kind of reusable image block?

The main advantage would seem to be backwards compatibility with themes, but would it be worthwhile to fallback to another mechanism for themes (now or in the future) that don't have support for logos?

Also, until we have the concept of a page header that we can add blocks to, how useful is this block? I can see circumstances where someone might want to include their logo in a sidebar or main post content, so maybe that's enough reason to build it.

@strarsis
Copy link
Contributor

The logo set in theme can also be treated as a site-wide logo, setting site app icon, favicon, etc.

@nickcernis
Copy link
Contributor

Instead of a dedicated logo block, should the wp:site-title block be extended to offer logo properties? wp:site-title would then:

  • Show the site title as text by default.
  • Provide controls to add a logo via the block properties.
  • Offer a “hide site title text” option so users can show the logo only if they wish.
  • Potentially use the user's custom-logo by default if one is set. Themes with custom-logo support that add <!-- wp:site-title /--> in a template part will then continue to show the custom-logo.

The logo is so often used as well as the title or in place of it, so this feels like a logical evolution.

@strarsis
Copy link
Contributor

strarsis commented Feb 20, 2020

@nickcernis: Though logo and site title are separate in traditional WordPress themes.

@pablinos
Copy link
Member

This has been brought up before, that they should be in the same block, but you then end up with the need to add more alignment settings etc.

Another option is to have separate site-title and site-logo blocks, and then to offer various block variations to cover how they would be used together.

@nickcernis
Copy link
Contributor

Another option is to have separate site-title and site-logo blocks, and then to offer various block variations to cover how they would be used together.

This sounds good. I like that it avoids the need to have “show title above/below logo” controls. We should probably favour drag-and-drop placement over placement controls where we can.

@strarsis
Copy link
Contributor

strarsis commented Apr 1, 2020

What can I use right now?
For the layout of a new site design the new full page editing feature comes right in time!
The menu block is already available, now I only need the logo block to rebuild the whole site as blocks.

@pablinos
Copy link
Member

This is the logo block PR #18811 - It's currently held up by a couple of problems with getting options from the API when you're not an admin. You might want to try rebasing that and installing it as a block.

You could always use an image of course!

@scruffian
Copy link
Contributor

We could still merge this and have it working like the other blocks in FSE...

@mtias
Copy link
Member Author

mtias commented Jun 8, 2020

Agreed, I don't think the admin circumstance should be a blocker. @epiqueras curious what you think of this block? I am not entirely sure if the logo is automatically being used for other purposes (favicon, mobile icon, etc).

@epiqueras
Copy link
Contributor

Yeah, that's my question, too, because it seems much more straightforward to just put a regular Image block in your header template part. I don't see much point in a dedicated Site Logo block, especially if it's read-only.

@paaljoachim
Copy link
Contributor

My guess is that Site Logo Block would be associated with the customizer. If one adds a site logo through Site Identity it would also automatically be added to the Site Logo block. That makes it different from a regular Image Block.

@shaunandrews
Copy link
Contributor

I’d expect a Logo block to be different from a normal Image block in at least a few ways:

  • No need for the Image caption in a Logo block.
  • I’d expect a logo block to support both Image and Text, and to smartly render the markup on the front end.
  • A Logo block could smartly adapt based on viewport size to hide and show variants of a logo.
  • I’d expect to be able to use the Logo block to define my sites favicon.

(It’s also possible I’m not understanding the discussion above. Feel free to ignore me if this is going off topic.)

@epiqueras
Copy link
Contributor

Shouldn't the favicon be handled in a site setting somewhere? Most of the time the logo is a different asset than the favicon right?

@strarsis
Copy link
Contributor

strarsis commented Jun 8, 2020

@epiqueras: Right, but for full site editing, all site features should be somehow modeled as Gutenberg blocks?

@epiqueras
Copy link
Contributor

Only the ones that you would use in the front end. The asset used for the favicon is probably different from the one used by a template's header, for example.

@strarsis
Copy link
Contributor

strarsis commented Jun 9, 2020

@epiqueras: The favicon/app icon can also be much more nuanced, with different icons (art direction) and postprocessing (background, margins, shadows) and app colors, see https://wordpress.org/plugins/favicon-by-realfavicongenerator/.

@epiqueras
Copy link
Contributor

Yeah, that's more reason just to use a regular image block, right?

@paaljoachim
Copy link
Contributor

Just a friendly reminder..:)
Could we get a status update of where this issue is at?

@scruffian
Copy link
Contributor

This block has been merged, so I think we can close this issue.

@paaljoachim
Copy link
Contributor

Closing issue.

@strarsis
Copy link
Contributor

@scruffian, @paaljoachim: It would be great to have a new Gutenberg release so I can use the Logo block in production! 🐱

@paaljoachim
Copy link
Contributor

Hey @strarsis

The Logo block for the site editor (Full Site Editing) has been released here: #18811

Regarding using various Full Site Editing blocks in the Post Editor (non FSE - regular Gutenberg screen) that I do not know anything about. Perhaps someone can reply to that aspect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core REST API Task Task for Core REST API efforts [Feature] Blocks Overall functionality of blocks New Block Suggestion for a new block
Projects
None yet
Development

No branches or pull requests