Problem/Motivation

Route title capitalization is inconsistent.

Let's standardize.

Route titles should be capitalized according to heirarchy.

For instance, the top-level route "Form API Examples" should be fully capitalized, but child paths should be capitalized on the first word and then lower-case, like "Simple form"

Proposed resolution

Look at the *.routing.yml file for each module.

Each route has a title: attribute.

For top-level routes, such as 'examples/fapi-example', the title should be fully capitalized.

For child routes, such as 'examples/fapi-example/simple-form', the first word should be capitalized, but not the rest.

Then do the same for the *.links.menu.yml files, so the link titles are the same as the route titles.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Mile23 created an issue. See original summary.

jalpesh’s picture

Assigned: Unassigned » jalpesh

Working on it.

jalpesh’s picture

Assigned: jalpesh » Unassigned
Status: Active » Needs review
FileSize
7.14 KB

Here we go with patch. Thanks.

Status: Needs review » Needs work

The last submitted patch, 3: capitalize_2897630.patch, failed testing. View results

LauraRocks’s picture

The patch failed one test which was testing the title in fapi_example -module (MultistepFormTest.php). This is a reroll of the patch with one additional change to that file so that the tests pass. I am working in DD&I contrib team together with mentor @zenlan

LauraRocks’s picture

Status: Needs work » Needs review
zenlan’s picture

Status: Needs review » Reviewed & tested by the community

Applied patch locally, test passed and route titles conform as per the proposed resolution.

Mile23’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the patch, and thanks for the review.

This looks like a good start.

The thing is, if you install the modules their route names still appear in all-caps in the menu bar. That's because we have to change them in the *.links.menu.yml file, too.

If you look at the fapi_example in particular, it's easy to see all the places that haven't been changed. If you look at examples/fapi-example in your browser, you'll see that the links in the template are also all-caps. That's the template in fapi_example/templates/description.html.twig.

It seems like there would be a way to specify the route name as the anchor text within twig so you can just specify that you want a link to a route without having to specify its name, but I haven't been able to find that.

Thanks!

navneet0693’s picture

FileSize
98.91 KB

@Mile23 I am quite confused here. So, I am attaching the screenshot of browser page of examples/fapi-examples I couldn't see the links in all-caps.

fapi api examples

Please help us with little more description.

MaskyS’s picture

Assigned: Unassigned » MaskyS

Will work on this. @navneet I think he means in the menu bar, not the links.

EDIT: Upon closer inspection, he is presumably referring to the fact that all the first letters are in caps in the links.

navneet0693’s picture

@Kifah Same behavior for menu bar also.

EDIT upon ur EDIT:

Yes, that's why just for getting clear, I left out a comment for him ;-)

MaskyS’s picture

Alright, fixed the names in *routing.yml as well as *.links.*.yml as well as *.html.twig as per OP and #8.

MaskyS’s picture

Status: Needs work » Needs review
Mile23’s picture

Title: Properly capitalize all route/path names » Properly capitalize all route/link names
Issue summary: View changes

The list in #9 is not generated by the links page. It's generated by the twig template.

But let's just work on route and link files for now.

Edit:

Oh, I see that #12 did some of that template work. We'll leave that in. :-)

navneet0693’s picture

Status: Needs review » Reviewed & tested by the community

Apologies for confusion this seems a good patch! nice work @Kifah

Mile23’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
20.23 KB
2.18 KB

Found a few more.

  • Mile23 committed ebf3634 on 8.x-1.x authored by Kifah Meeran
    Issue #2897630 by Mile23, Kifah Meeran, jalpesh, LauraRocks, navneet0693...
Mile23’s picture

Status: Needs review » Fixed

And done. Thanks everyone!

navneet0693’s picture

Status: Fixed » Reviewed & tested by the community

EDIT: You are way faster, i was double checking the patch this time :-P

navneet0693’s picture

Status: Reviewed & tested by the community » Fixed

OOOOps, I am really sorry.

Mile23’s picture

No worries. :-)

Status: Fixed » Closed (fixed)

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