Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mherchel created an issue. See original summary.

nitesh624’s picture

Assigned: Unassigned » nitesh624

working on it will update in few hours

nitesh624’s picture

Assigned: nitesh624 » Unassigned
Status: Active » Needs review
FileSize
393 bytes
23.9 KB

After applying the patch
olivero

mherchel’s picture

Title: Homepage has an empty title block div with an empty H1 » Olivero homepage has an empty title block div with an empty H1
Project: Olivero » Drupal core
Version: 8.x-1.x-dev » 9.1.x-dev
Component: Code » Olivero theme
mherchel’s picture

Status: Needs review » Needs work

There's also the empty page title block div, along with the shortcut wrapper. However if we remove the page title block div, the entire layout shifts, which is undesirable. We may need to make some CSS changes too.

kostyashupenko’s picture

Status: Needs work » Needs review
FileSize
473 bytes

However if we remove the page title block div, the entire layout shifts, which is undesirable

Right now margins added for block level, not for page_title, and block level now exist after this patch still, but empty. I have checked - we have the same issue in Claro theme, page title is empty with empty h1 inside. So... If we can keep empty div block-page-title, then this patch is enough. But.. If there is no real title, then block-page-title shouldn't be rendered, correct? If yes, then looks like this is issue of core, not really of Olivero.

kostyashupenko’s picture

mherchel’s picture

The best way to handle this is to change the configuration to remove the title block from the frontpage. This would negate the need for the preprocessing, and it would also allow the site-builder to re-enable the title on the frontpage if they wish.

Unfortunately, this will require a configuration change, which I'm unsure if we can do... although it may be possible before the first release.

I talked with @lauriii in Drupal slack, and he said to post a patch.

Note that the changes in the CSS are to compensate for the block div not being present (with its margin), and also note in preprocess the shortcut-wrapper div is not needed (pretty sure that was copied over from another theme while initially setting up the scaffolding).

mherchel’s picture

The previous patch unintentionally removes the title block on the "Welcome to Drupal" getting started page.

This patch fixes that by inserting the title into the template (and fixing the h1 font and compensating for the increased margin).

mherchel’s picture

Issue summary: View changes
mherchel’s picture

Status: Needs review » Needs work

Talked with @lauriii a bit more in Drupal slack. The approach in #9 is a little weird, because if a site-builder edits the frontpage view to create a title, it still will not show. In addition that solution doesn't solve the problem for other views that might have a blank title.

mherchel’s picture

Status: Needs work » Reviewed & tested by the community

I'd really like to prevent the block and region markup from showing. However, I keep on running into #953034: [meta] Themes improperly check renderable arrays when determining visibility.

Unfortunately, it's not easy to check if data exists without having unintended consequences. I think the best solution at this point is #6.

So, RTBC #6

xjm’s picture

Generally one should reupload the intended patch as the final patch to avoid committers accidentally committing the wrong thing. For now, I'm at least hiding the newer patches.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

Even though the approach in #6 isn't ideal, it's probably the pragmatic way to go. I think we should use the same approach with Umami which is {% if title|render|striptags|trim %}.

ayushmishra206’s picture

Status: Needs work » Needs review
FileSize
494 bytes
7.21 KB

Made the change suggested in #14.

mherchel’s picture

Status: Needs review » Needs work

@ayushmishra206 we need to go with the approach in #6 with what @lauriii mentioned in #14.

ayushmishra206’s picture

FileSize
479 bytes
7.19 KB
mherchel’s picture

@ayushmishra206 See my previous comment. I appreciate the work that you're doing, but you're working on an approach that will not be accepted. Please read through my comments before posting a patch.

markdorison’s picture

Status: Needs work » Needs review

Hiding the patches from #15 and #17 to avoid confusion.

@mherchel You marked this issue as RTBC in reference to the #6 patch. Is that the case from your perspective?

mherchel’s picture

Status: Needs review » Needs work

Correct, however @lauriii (in comment #14) mentioned that we should use {% if title|render|striptags|trim %} instead of |render. Should be a quick change.

markdorison’s picture

Status: Needs work » Needs review
FileSize
494 bytes
walangitan’s picture

Status: Needs review » Reviewed & tested by the community

Patch in #21 applies cleanly in my testing. Tests also passed, marking this as RTBC.

mherchel’s picture

+1 on the RTBC!

  • lauriii committed cee06eb on 9.2.x
    Issue #3177231 by mherchel, ayushmishra206, kostyashupenko, nitesh624,...

  • lauriii committed 36b2e87 on 9.1.x
    Issue #3177231 by mherchel, ayushmishra206, kostyashupenko, nitesh624,...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed cee06eb and pushed to 9.2.x and 9.1.x. Thanks!

jibran’s picture

{% if title|render|striptags|trim %} should these three function calls be converted to a helper method? It is pure drupalism and one should not have to remember this.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.