richardsoper - 2 weeks ago

Im attempting to create a custom add-on to manage products for an e-commerce site I am building. I created a new stream and set up the fields as shown here: https://pastebin.com/rDJxutTt However when I load into the add-on in the admin panel it only shows the name and slug fields with the identifiers "snipcart.module.products::field.name.name", and "snipcart.module.products::field.slug.name". Im pretty new to PyroCMS so if you've got any suggestions I would greatly appreciate it.

Answer

finnito - 2 weeks ago

He @richardsoper!

What is being displayed is the language file key that it is trying to display. In your addon at resources/lang/en/field.php you can set the name of that language key.

E.g.


<?php

return [
    "name.name" => "The Column Name",
];

edster - 2 weeks ago

Are you talking about in the table view? If so you need to make sure your table builder is configured to render all the fields.

Are the columns in your table/ listed in the base model?

More details would be great if that isn't it. Also please try to format your arrays so they are more readable

richardsoper - 2 weeks ago

So I solved part of my problem and I get all my fields to show up. But Im still getting some ugly labels showing https://imgur.com/a/4vxRzZ0

The table builder file I have is super simplistic since I just want to display three columns in the admin panel: https://pastebin.com/MiV9ieqr

I don't even know where to begin. Sorry if this is a dumb question.

finnito - 2 weeks ago

He @richardsoper!

What is being displayed is the language file key that it is trying to display. In your addon at resources/lang/en/field.php you can set the name of that language key.

E.g.


<?php

return [
    "name.name" => "The Column Name",
];

richardsoper - 2 weeks ago

@finnito that was the big part I was missing here. Thank you very much.

finnito - 2 weeks ago

ryanthompson - 2 weeks ago

@finnito dude.. I seriously did not know you could define lang stuff in dot notation like that. GAME CHANGER!

finnito - 2 weeks ago

@ryanthompson Hah! I assumed that I had read it in your source code somewhere!