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

Will the title be a block (movable)? #7359

Closed
manake opened this issue Jun 18, 2018 · 3 comments
Closed

Will the title be a block (movable)? #7359

manake opened this issue Jun 18, 2018 · 3 comments

Comments

@manake
Copy link

manake commented Jun 18, 2018

I want to position a block above the title but it's not movable.

So, I'm doing this bad workaround for now: (1) disable rendering of one block and (2) render it above the title via do_action( 'place_before_the_title' ). Not nice.

Related features that could help:

  1. Add option "Additional CSS Classes" to the title
  2. Add option "Additional CSS Classes" to the whole page

Possible alternative solution
Make core/title block which, when inserted, would disable the_title()'s output and print it in the place of the block. (But really this is also a bad workaround and a movable title block would be better.)

(Also this is a common use case to disable the title completely which is achievable only using meta boxes now.)

@leahkoerper
Copy link
Contributor

In January @mtias said the title would become a block in phase two when they handle page layouts. Assuming that's still true, it means we won't get a title block until a ways after the 5.0 release.

@manake
Copy link
Author

manake commented Jun 19, 2018

Thank you.

Does anyone know if it's already established (or if there are any predictions) how this will be achieved? add_theme_support( 'editor-the-title-is-a-block-in-this-theme' )? And then page.php etc. should remove the_title() calls?

Is there any workaround for this for now? So far I had a "Content before the title" textarea in a meta box where a shortcode could be inserted but now this shortcode is a block. I guess my present workaround is the best that can be done for now?

@mtias
Copy link
Member

mtias commented Jun 19, 2018

@leahkoerper is correct. That's on the roadmap for v2.

Once gutenberg controls areas beyond the post_content the title would be just another block (together with post date, author byline, etc). Themes would likely start using another function like do_blocks( $template_definition ) rather than the_content().

If you want to achieve something similarly now, you'd just configure your theme to not output a title and include a block for it instead. You'd then include the title block for any new post as part of the default template. I'm not sure I would recommend this, though, unless you are comfortable making any necessary updates once v2 is in progress and taking on that overhead.

A good example might be the Google/AMP travel demo: https://amp-travel.xwp.io/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants