Hello everyone!
Is there a way to set global variables within a project?
My social media links are always the same and are replicated in multiple locations (some inside components, others on the pages themselves), where can I set them up once and then simply call them as dynamic content?
Is this a function that already exists?
There’s no system for this yet, but if you want you can create plugin that will create variable with socials for example, then you can use them whenever on the website.
Let me know and I can show you how.
Well this would be super useful I think?
Yes. I can try. Can you show me how?
Solution 1 - Using Collections
For smaller collections, you can set them to be available as variable, for example “Socials”.
You can also choose if you want variable to be an array or object.
Array suitable for iterable, like Socials
Object suitable for direct accessing, like logo, emails, etc.
Solution 2 - Creating a File Plugin
You can create file plugin and add variable manually.
Then use iterable or variable system to display socials:
Thank you so much!
I used the File Plugin procedure and everything works perfectly!
Great job!!!