Setting variables

For Joomla! 3.x Coding related discussions, you could also use: http://groups.google.com/group/joomla-dev-general

Moderators: ooffick, General Support Moderators

Forum rules
Locked
Johnbillau
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Jan 05, 2016 11:16 am

Setting variables

Post by Johnbillau » Sat Oct 06, 2018 3:53 pm

Hi there,

I need to be able to set some variables that are accessible in every page of my Joomla site.

Could someone tell me the best way to do this please?

Thanks in advance

John
Last edited by toivo on Sat Oct 06, 2018 5:34 pm, edited 1 time in total.
Reason: mod note: moved to 3.x Coding

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44071
Joined: Sat Apr 05, 2008 9:58 pm

Re: Setting variables

Post by Webdongle » Sat Oct 06, 2018 4:30 pm

http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Johnbillau
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Jan 05, 2016 11:16 am

Re: Setting variables

Post by Johnbillau » Sat Oct 06, 2018 5:50 pm

Thanks for that. After reading it, I'm not entirely sure if it will do what I want. I need the same variables to be set permanently for everyone who visits the site. Apologies if I've read it wrong :-)

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44071
Joined: Sat Apr 05, 2008 9:58 pm

Re: Setting variables

Post by Webdongle » Sat Oct 06, 2018 5:57 pm

http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Johnbillau
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Jan 05, 2016 11:16 am

Re: Setting variables

Post by Johnbillau » Sat Oct 06, 2018 6:48 pm

Ah, thanks very much. I think that will work! :-)

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44071
Joined: Sat Apr 05, 2008 9:58 pm

Re: Setting variables

Post by Webdongle » Sat Oct 06, 2018 6:54 pm

Is not the second link just the practical application of the information of the Joomla docs page I first linked to ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Johnbillau
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Jan 05, 2016 11:16 am

Re: Setting variables

Post by Johnbillau » Sun Oct 07, 2018 11:43 am

I'm not sure, you're the Joomla Master, not me.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44071
Joined: Sat Apr 05, 2008 9:58 pm

Re: Setting variables

Post by Webdongle » Sun Oct 07, 2018 11:59 am

You are the one writing the extension so you should know if they are both the same coding that works in your extension.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Johnbillau
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Jan 05, 2016 11:16 am

Re: Setting variables

Post by Johnbillau » Sun Oct 07, 2018 1:38 pm

I am not writing an extension.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44071
Joined: Sat Apr 05, 2008 9:58 pm

Re: Setting variables

Post by Webdongle » Sun Oct 07, 2018 2:11 pm

Then why do you need to set Global variables in Joomla ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Johnbillau
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Jan 05, 2016 11:16 am

Re: Setting variables

Post by Johnbillau » Sun Oct 07, 2018 2:43 pm

I'm writing some php that I was going to insert into articles using sourcerer. The code should be able to be copied to a few different websites by just changing 1 variable. Apologies, I'm fairly new to this. There's probably a better way!

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44071
Joined: Sat Apr 05, 2008 9:58 pm

Re: Setting variables

Post by Webdongle » Sun Oct 07, 2018 3:05 pm

No a good idea writing that much php to put Directly into Articles. Best use (or create a Component).
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Johnbillau
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Jan 05, 2016 11:16 am

Re: Setting variables

Post by Johnbillau » Sun Oct 07, 2018 3:45 pm

Ah, thanks for the heads up. Guess I've gotta start a whole new journey now!



Locked

Return to “Joomla! 3.x Coding”