How to change text of this span object with no selectors?

This object has the following HTML:

<span>Topic</span>

I’m wondering how one might use css to change this text to something else, e.g. “Blogs”.

EDIT: I would want to do this on a per-category basis.

1 Like

This is customisable via /admin/customize/site_texts?q=Topics

I’m not sure exactly which one it is though…

You can figure it out by running I18n.enableVerboseLocalizationSession() in the JS console, reloading the page, then you’ll be able to correlate the number of the string with output in the console:

2 Likes

This would be for all categories though, right? I want to do it per category.

1 Like

Hello :wave:

This is possible with CSS.

body.category-name {
  .topic-list-header {
    .default.topic-list-data {
      span {
        visibility: hidden;
        &:before {
          content: "Blogs";
          visibility: visible;
        }
      }
    }
  }
}
2 Likes

I wish I could give you 10 likes! Thank you so much, Don!

3 Likes

If you want to do this on multiple categories and avoid having many SCSS lines, you can use SCSS loops. It makes the code easier to read and maintain because you’ll just have to edit two SCSS variables.

4 Likes

I’m going to try to make this into a theme plugin, thanks for this loop idea!

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.