vanilophp / category

Category Module for Vanilo (or any Laravel app) https://vanilo.io
MIT License
7 stars 4 forks source link

Adding custom fields to Taxonomy #5

Closed RonnieTaz closed 2 years ago

RonnieTaz commented 2 years ago

Is it possible to add extra fields to Taxonomy apart from its two main fields? I have an app that needs to have categories with images. I want to add some fields in the taxonomy to hold the URL of the image and another field to mark the taxonomy name as it comes from another server. Is this possible?

fulopattila122 commented 2 years ago

Yes, it is. Before we continue, one question: are you using the entire Vanilo framework or just the standalone category module?

fulopattila122 commented 2 years ago

I am asking because assigning images to taxons/taxonomies in the framework is possible.

Assign Images

The framework extends the base models with image capabilities, using (by default) the Spatie Media Library

image

If this solution doesn't work for you, please let me know, there are alternatives.

Adding New Fields

Adding new fields to a model is also possible, described step by step here: https://vanilo.io/how-to/use-custom-models-in-your-application

RonnieTaz commented 2 years ago

Yes, it is. Before we continue, one question: are you using the entire Vanilo framework or just the standalone category module?

The standalone category module and some other modules.

Adding new fields to a model is also possible, described step by step here: https://vanilo.io/how-to/use-custom-models-in-your-application

I think I will take this approach. Much thanks.