fbpx

REPUBLIC DAY SALE

FLAT 40% OFF

Days
Hours
Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] Developing in local environment ? (Mamp, Wamp...) — Using Custom Code inclusion (JS, CSS...) Find a way to have the same URL call on both local and live environment.

[SOLVED] Developing in local environment ? (Mamp, Wamp...) — Using Custom Code inclusion (JS, CSS...) Find a way to have the same URL call on both local and live environment. 1 month 9 hours ago #26790

  • Chacapamac
  • Chacapamac's Avatar
  • Offline
  • Elite Member
  • Posts: 222
  • Thank you received: 5
  • Karma: 0
I’m developing my websites on Mamp and I also have a dedicated live test environment.
I was bug by having to change the call for my custom code snippets to work on both the local and the live test environment.

Yes, I know, I can have my websites using virtual host in Mamp but I also find another easy way...

Example of code working on local and live.
This is a simple call for a Javascript file, before head, placed in ASTROID Template > Custom Code > Before Head
(Work Also in Joomla menus , Astroid options tabs > Custom Code)
./templates/astroid_template_zero/js/aos.js

Simply put a dot before the first (./) of the relative URL .

Happy New Year Everybody! :P
Last Edit: 4 weeks 8 hours ago by Chacapamac.
The topic has been locked.

Developing in local environment ? (Mamp, Wamp...) — Using Custom Code inclusion (JS, CSS...) Find a way to have the same URL call on both local and live environment. 4 weeks 1 day ago #26845

  • chandandeep
  • chandandeep's Avatar
  • Offline
  • Administrator
  • Posts: 4117
  • Thank you received: 607
  • Karma: 105
Hello.

I suggest use Custom JS Files field to load JS file.

With this example.
templates/astroid_template_one/js/filename.js

Happy New Year

Thanks,
Chandan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.

To know more about products check out the their documentation.
The topic has been locked.

Developing in local environment ? (Mamp, Wamp...) — Using Custom Code inclusion (JS, CSS...) Find a way to have the same URL call on both local and live environment. 4 weeks 1 day ago #26875

  • Chacapamac
  • Chacapamac's Avatar
  • Offline
  • Elite Member
  • Posts: 222
  • Thank you received: 5
  • Karma: 0
Thanks “chandandeep” !
Yep, both work, even on local Mamp installation without using Virtual hosts.

Do you think one method is better than the other ?
./templates/astroid_template_one.....
or directly
templates/astroid_template_one
The topic has been locked.

Developing in local environment ? (Mamp, Wamp...) — Using Custom Code inclusion (JS, CSS...) Find a way to have the same URL call on both local and live environment. 4 weeks 20 hours ago #26892

  • chandandeep
  • chandandeep's Avatar
  • Offline
  • Administrator
  • Posts: 4117
  • Thank you received: 607
  • Karma: 105
Use without dot.
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.

To know more about products check out the their documentation.
The topic has been locked.
The following user(s) said Thank You: Chacapamac

Developing in local environment ? (Mamp, Wamp...) — Using Custom Code inclusion (JS, CSS...) Find a way to have the same URL call on both local and live environment. 4 weeks 8 hours ago #26913

  • Chacapamac
  • Chacapamac's Avatar
  • Offline
  • Elite Member
  • Posts: 222
  • Thank you received: 5
  • Karma: 0
Thanks You,
Without dot work perfectly, my way now! :cheer:

Suggestion: maybe you can add that to your documentation when entering Custom Code in the Template manager and Joomla menus Astroid options

Will help people that prefer a local URL and work on local environment first.
The topic has been locked.

Developing in local environment ? (Mamp, Wamp...) — Using Custom Code inclusion (JS, CSS...) Find a way to have the same URL call on both local and live environment. 3 weeks 6 days ago #26928

  • chandandeep
  • chandandeep's Avatar
  • Offline
  • Administrator
  • Posts: 4117
  • Thank you received: 607
  • Karma: 105
We already did this. Please check this out. We never said use dot with path.

docs.joomdev.com/article/astroid-custom-js/

Happy New Year
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.

To know more about products check out the their documentation.
The topic has been locked.

Developing in local environment ? (Mamp, Wamp...) — Using Custom Code inclusion (JS, CSS...) Find a way to have the same URL call on both local and live environment. 3 weeks 6 days ago #26935

  • Chacapamac
  • Chacapamac's Avatar
  • Offline
  • Elite Member
  • Posts: 222
  • Thank you received: 5
  • Karma: 0
You absolutely right, I didn’t read everything, it’s clear

Happy New Year Joomdev — I’m happy to have chosen Astroid
The topic has been locked.

Developing in local environment ? (Mamp, Wamp...) — Using Custom Code inclusion (JS, CSS...) Find a way to have the same URL call on both local and live environment. 3 weeks 2 days ago #26988

  • nishtha
  • nishtha's Avatar
  • Offline
  • Moderator
  • Posts: 1920
  • Thank you received: 176
  • Karma: 25
Hey,

Happy New Year!

Considering the problem solved, topic shall now be closed.

Thanks,
Nishtha
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.

To know more about products check out the their documentation.
The topic has been locked.
Moderators: chandandeep
Time to create page: 0.418 seconds