SOLVED: Template Import - Classes renamed with "__imported"

Bricks v1.5b
PHP 7.4
Bricks Official Child Theme

Plugins active ACSS - Bricks - CPTUI - ACF Pro

Site A - build out a page section - save as a template - export template - to local folder

Site B - (same config as above)

  • import template to lib
  • check template in builder looks ok’ish
  • import section to page again looks ok but some styling is missing

Check FE

  • Some ACSS class’s appear to be effected mainly alignment
  • All custom css class’s have gain a name extension __imported
  • New class’s cannot be deleted via the Bricks Panel you get the first “are you sure” but still not able to delete
  • All containers with a query loop have not honored the setup on template import

And it was all going so well

And there are more images available but the forum only allows a new user one attachment - really…

1 Like

Hi @sms-bricks, and welcome to the forum :wave:

When importing a template that contains a class name that already exists in the installation, the __imported class name suffix is added by default. But only if the class name’s unique identifiers differ (those are not visible in the UI). Which is not the case when using ACSS classes as they come with a hard-coded identifier, that is the same on every installation.

But it might be best to not run this suffix __imported logic by default, and provide a setting for it instead. That way class names that already exist, are simply skipped by default.

I can’t replicate this issue? Could you share some temporary admin login details via PM with me, so I can have a look at your site?

Could you explain in more detail what you mean by that?

If you could share a short screencast in your PM as well, that’d be perfect. Thank you.

1 Like

Having this problems as well!

PHP 7.4
Bricks 1.5 RC2
Bricks Child Theme
Automatic CSS Version 2.0.0-rc1, all classes locked
Template json file from: Dropbox - template-acss-bg-color-grid-2022-07-18.zip - Simplify your life
Which is a Template for viewing the Automatic CSS colours

Imported the template, every class had an added __imported. Quite a few classes that I then had to delete. Hopefully there is a faster way to deleted unused classes as having to wait on your alert “Global Class Deleted” while I manually deleted what seemed like hundreds of classes was tedious.

I’d done a wee bit of work after my last backup and thought I should have a look at the shades of some of my colours. I made the mistake of importing the template without doing another backup.

On another site with an earlier version of Bricks I was able to import this template successfully but have since updated that site, as well, to Bricks 1.5 RC2.

Without the ability to import a template without Bricks messing with the classes means I’ll have to drop back to an earlier version until I find one that imports properly.

I was about to post this as a bug also, when I found this report. Imported Guillermo Dewey’s template to show ACSS colours and get all of the ACSS classes duplicated but with __imported added, plus they have no styling attributed to them, so the already existing ACSS styling doesn’t get used.

Now have to go through every imported style and delete it… Is there no way currently to select multiple classes and delete them?

@thomas Can you take a look at how Cwicly’s is handling classes? It has an external class manager (I know this will come to Bricks in future) with folders/buckets. You can set a color for the folder/bucket, import/export classes and all classes in the editor will show with that color to differentiate. Regarding import may be you can give an option to avoid importing classes with same name or import them with _imported.

1 Like

I think they’re done it really well too. Definitely inspiration to look at here.

1 Like

Hi, it looks like even when deleting the imported layout with the misnamed classes the classes stay in the database in the options table (bricks_global_classes). Since there is no external way of managing imported or custom classes (if I understand this correctly), would a question “hey these clasdes already exist in the system. What do you want to do?” (overwrite, duplicate [here is where you add __imported], no not import) be a temporary solution? I’m not sure how difficult this is to do or implements but not having a place to manage imported classes that stay in the system is less then optimal.
Alternatively if all elements on this page are deleted, can you delete the imported classes as well?

1 Like

Something similar to how it handles importing templates would be great

Hi guys,
The “class manager” found its way into Bricks 1.9.5, now available as a one-click update in your WordPress Dashboard.

Changelog: Bricks 1.9.5 Changelog – Bricks

Yes I noticed, I was expecting a YT video for the changelog, or is that in the pipeline for an FB announcement