Joomla Variables
-
- Joomla! Intern
- Posts: 90
- Joined: Thu Jun 15, 2006 2:18 am
Joomla Variables
Is there a document that has all the available variables one could use in building customer templates? I would think having a template variable definition document would make a lot of sense.
-
- Joomla! Apprentice
- Posts: 12
- Joined: Tue Sep 13, 2005 6:36 pm
Re: Joomla Variables
No kidding. I definitely second this. Is there any info on what variables are available from a template?
-
- Joomla! Intern
- Posts: 90
- Joined: Thu Jun 15, 2006 2:18 am
Re: Joomla Variables
Apparently we are the only ones that feel this way, since it took over 30 days for me to even get one response. A document of available template variables should be the basis for ANY add-on application or free-standing development built for Joomla, but apparently we are on our own.
-
- Joomla! Fledgling
- Posts: 1
- Joined: Mon Sep 04, 2006 9:23 am
Re: Joomla Variables
Has anybody found a list of variables and functions yet?
I'm designing a template as we speak, and I was surprised by the fact that functions like mosPathWay() and variables like $mosConfig_sitename don't appear to be documented...
I'm designing a template as we speak, and I was surprised by the fact that functions like mosPathWay() and variables like $mosConfig_sitename don't appear to be documented...
-
- Joomla! Apprentice
- Posts: 7
- Joined: Fri Sep 08, 2006 12:29 pm
Re: Joomla Variables
Agree!!!ddmobley wrote: Is there a document that has all the available variables one could use in building customer templates? I would think having a template variable definition document would make a lot of sense.
There must be something somewhere. I am now in the mood for Drupal since I cant find documentation for anything at Joomla. To search the forums for everything should not be necessary. I have just wasted one hour searching for information about variables with luck.
- Terje
-
- Joomla! Apprentice
- Posts: 10
- Joined: Mon Dec 25, 2006 2:30 pm
Re: Joomla Variables
I agree too. I'm desperately looking for a couple of hours now for such a thing - HELP!!!
- OnTheMarkDesign
- Joomla! Enthusiast
- Posts: 191
- Joined: Thu Apr 24, 2008 10:11 pm
- Location: Inland Empire, California, USA
- Contact:
Re: Joomla Variables
Check in the Documentation area of the Joomla site. If there hasn't already been a document listing all the available variables started, take the initiative and start it!ddmobley wrote:Is there a document that has all the available variables one could use in building customer templates? I would think having a template variable definition document would make a lot of sense.
Joomla! Community Magazine Team Member
Follow Me at https://twitter.com/OnTheMarkDesign
Follow Me at https://twitter.com/OnTheMarkDesign
-
- Joomla! Guru
- Posts: 692
- Joined: Thu Aug 18, 2005 10:51 pm
- Location: Austria
- Contact:
Re: Joomla Variables
As i understood the former postings, they are newbies.OnTheMarkDesign wrote:Check in the Documentation area of the Joomla site. If there hasn't already been a document listing all the available variables started, take the initiative and start it!
So how they can start a (new) documentation?
But it seems that you are knowing more about - why not you?
http://www.joomx.com - custom extensions and development
http://www.joomlasupportdesk.com - support, migration, training and consulting
Member of the German Joomla Translation Team
http://www.joomlasupportdesk.com - support, migration, training and consulting
Member of the German Joomla Translation Team
-
- Joomla! Apprentice
- Posts: 10
- Joined: Sun Oct 19, 2008 6:29 pm
- Location: USA
- Contact:
Re: Joomla Variables
a cumbersome way of doing this would be to write something like this
<?php
session_start();
foreach($_SESSION as $key => $val)
{
echo $key . " : " . $val . "<br>";
}
?>
you would need it on the footer or index page and then as you navigate your site you would see all the session variables and their values.. this would let you build up a library very quickly with quick copy and paste
<?php
session_start();
foreach($_SESSION as $key => $val)
{
echo $key . " : " . $val . "<br>";
}
?>
you would need it on the footer or index page and then as you navigate your site you would see all the session variables and their values.. this would let you build up a library very quickly with quick copy and paste
Mambo was great joomla looks to be better
- OnTheMarkDesign
- Joomla! Enthusiast
- Posts: 191
- Joined: Thu Apr 24, 2008 10:11 pm
- Location: Inland Empire, California, USA
- Contact:
Re: Joomla Variables
Let me look into the Documentation section regarding the "variables". If nothing is already started, I'd be interested in "collecting" the variables for a "listing page" of them.mic wrote:As i understood the former postings, they are newbies.OnTheMarkDesign wrote:Check in the Documentation area of the Joomla site. If there hasn't already been a document listing all the available variables started, take the initiative and start it!
So how they can start a (new) documentation?
But it seems that you are knowing more about - why not you?
Joomla! Community Magazine Team Member
Follow Me at https://twitter.com/OnTheMarkDesign
Follow Me at https://twitter.com/OnTheMarkDesign
-
- Joomla! Apprentice
- Posts: 10
- Joined: Mon Dec 25, 2006 2:30 pm
Re: Joomla Variables
I thank you, good people, for your efforts.OnTheMarkDesign wrote:Let me look into the Documentation section regarding the "variables". If nothing is already started, I'd be interested in "collecting" the variables for a "listing page" of them.mic wrote:As i understood the former postings, they are newbies.OnTheMarkDesign wrote:Check in the Documentation area of the Joomla site. If there hasn't already been a document listing all the available variables started, take the initiative and start it!
So how they can start a (new) documentation?
But it seems that you are knowing more about - why not you?
- OnTheMarkDesign
- Joomla! Enthusiast
- Posts: 191
- Joined: Thu Apr 24, 2008 10:11 pm
- Location: Inland Empire, California, USA
- Contact:
Re: Joomla Variables
I've learned a lot from the others who posted their problems (and solutions) here in the Joomla Forums. Bookmarking or subscribing to a thread has come in very handy while building my first 3 Joomla sites.effectus wrote:
I thank you, good people, for your efforts.
I'm working on a "core elements" document that lists all the modules/plugins/etc. that I utilize in my Joomla sites. And a checklist of what I've done with each site.
Search is your friend on this Forum. Joomla is an everchanging tool.
The Documentation of Joomla is one area that could be "worked" on! I've learned much about Joomla while reading the Joomla Documentation Wiki! while doing some "editing" on the current articles in the Wiki.
Joomla! Community Magazine Team Member
Follow Me at https://twitter.com/OnTheMarkDesign
Follow Me at https://twitter.com/OnTheMarkDesign
- OnTheMarkDesign
- Joomla! Enthusiast
- Posts: 191
- Joined: Thu Apr 24, 2008 10:11 pm
- Location: Inland Empire, California, USA
- Contact:
Re: Joomla Variables
Template FAQ's from Joomla Documentation might be a place to start!ddmobley wrote:Is there a document that has all the available variables one could use in building customer templates? I would think having a template variable definition document would make a lot of sense.
Joomla! Community Magazine Team Member
Follow Me at https://twitter.com/OnTheMarkDesign
Follow Me at https://twitter.com/OnTheMarkDesign
-
- Joomla! Apprentice
- Posts: 10
- Joined: Mon Dec 25, 2006 2:30 pm
Re: Joomla Variables
@OnTheMarkDesign: Thanks for your work - looking forward to it.
Thanks for the tips too. Of course I first tried searching the forum, as well as the wiki, the documentation and the API. Nowhere could I find a clear list of typically-used variables and objects in a standard Joomla template. Tried a web search too - zilch.
Couldn't see anything related to this (vars, objects) on the template FAQ link either - am I missing anything?
Thanks for the tips too. Of course I first tried searching the forum, as well as the wiki, the documentation and the API. Nowhere could I find a clear list of typically-used variables and objects in a standard Joomla template. Tried a web search too - zilch.
Couldn't see anything related to this (vars, objects) on the template FAQ link either - am I missing anything?
- OnTheMarkDesign
- Joomla! Enthusiast
- Posts: 191
- Joined: Thu Apr 24, 2008 10:11 pm
- Location: Inland Empire, California, USA
- Contact:
Re: Joomla Variables
Appreciate the comment. It will take some time to "accumulate" the variables. Fortunately, Joomla comes with 2 front end templates, and 1 admin. template.effectus wrote:@OnTheMarkDesign: Thanks for your work - looking forward to it.
I just starting reading the Joomla Doc's. (Wiki) about a month ago. Have been on the Forum since April, and it has been a great resource along with 2 Books I have bought. Barrie Norths "Joomla, A User's Guide", and "Professional Joomla" by Dan Rahmel.Thanks for the tips too. Of course I first tried searching the forum, as well as the wiki, the documentation and the API. Nowhere could I find a clear list of typically-used variables and objects in a standard Joomla template. Tried a web search too - zilch.
Couldn't see anything related to this (vars, objects) on the template FAQ link either - am I missing anything?
North's book covers the basics that you must know on how to make your Joomla site function. Rahmel's book covers more of the "complex" things like the "raw code" on Joomla, and developing your own modules and templates.
I'll investigate what has been done on the Wiki regarding the "variables" of the 3 templates. I do know that there is some content regarding the templates, but to what extent "I don't know at this point in time". If no one is currently working on such a "project" on the Wiki, I'd be interested in helping on it!
Joomla! Community Magazine Team Member
Follow Me at https://twitter.com/OnTheMarkDesign
Follow Me at https://twitter.com/OnTheMarkDesign
-
- Joomla! Apprentice
- Posts: 10
- Joined: Mon Dec 25, 2006 2:30 pm
Re: Joomla Variables
Got those 2 books myselfOnTheMarkDesign wrote: I just starting reading the Joomla Doc's. (Wiki) about a month ago. Have been on the Forum since April, and it has been a great resource along with 2 Books I have bought. Barrie Norths "Joomla, A User's Guide", and "Professional Joomla" by Dan Rahmel.

They definitely help a lot in understanding how things work - but they lack good quick-references chapters that you can quickly refer to when working. This is where I think a good API reference comes in handy, but for Joomla the API is quite cryptic if you're not a pro.
Thanks again OnTheMarkDesign !
- Chris Davenport
- Joomla! Ace
- Posts: 1385
- Joined: Thu Aug 18, 2005 8:57 am
- Location: Shrewsbury, Shropshire, United Kingdom
Re: Joomla Variables
Apart from the automatically generated API documentation (http://api.joomla.org) we are in the process of writing additional material here: http://docs.joomla.org/API_Reference_Project
One of the great strengths of the Joomla 1.5 template architecture is that it gives you access to the full API from within the template, consequently there's an awful lot to document! However, in addition to the above-mentioned API Reference material, I do intend to work on more specific template documentation, but it is likely to be some months before it is ready.
Regards,
Chris.
One of the great strengths of the Joomla 1.5 template architecture is that it gives you access to the full API from within the template, consequently there's an awful lot to document! However, in addition to the above-mentioned API Reference material, I do intend to work on more specific template documentation, but it is likely to be some months before it is ready.
Regards,
Chris.
Chris Davenport
Davenport Technology Services http://www.davenporttechnology.com/
Lion Coppice http://www.lioncoppice.org/
Davenport Technology Services http://www.davenporttechnology.com/
Lion Coppice http://www.lioncoppice.org/
-
- Joomla! Apprentice
- Posts: 10
- Joined: Mon Dec 25, 2006 2:30 pm
Re: Joomla Variables
Great news, Chris. Really nice to see the progress Joomla is making - and these documentation news are a great example.Chris Davenport wrote:Apart from the automatically generated API documentation (http://api.joomla.org) we are in the process of writing additional material here: http://docs.joomla.org/API_Reference_Project
One of the great strengths of the Joomla 1.5 template architecture is that it gives you access to the full API from within the template, consequently there's an awful lot to document! However, in addition to the above-mentioned API Reference material, I do intend to work on more specific template documentation, but it is likely to be some months before it is ready.
Regards,
Chris.
If it will be anything like the PHP documentation it wants to follow - coding for the 1.5 framework will be much simpler. Good on you!
- andpatton
- Joomla! Apprentice
- Posts: 23
- Joined: Fri May 29, 2009 3:50 pm
- Contact:
Re: Joomla Variables
In working on a new template, I ran across this same question and uncovered this encouraging, though currently fairly unhelpful, thread. However, I did take people's queues and gave the Template category in the Joomla! Documentation wiki a shot. One of the articles I discovered was this one:
How are templates executed?
According to that article,
While those would seem to be usable variables and methods, I also noticed that it doesn't mention the ubiquitous $baseurl variable that every template uses to link to stylesheets and images and the like. As it turns out, that variable is assigned in the render() method of the JDocumentHTML class (around line 217 of /libraries/joomla/document/html/html.php), which is the method responsible for "Outputting the template to the browser." In that method, the $this->template variable (the name of the directory containing the current template) and the $this->baseurl variable are both assigned, as well as a $this->params object, which is generated from the params.ini file of your current template.
So, the full list? Well, if you want to mess with methods, I suggested reading up on the JDocument Class on your own and trying to figure them out, but the list of variables (accessible from the $this object) is as follows, as far as I can tell (all are strings, unless otherwise noted):
Disclaimer: I have only actually ever used $this->baseurl, $this->template, and $this->language (very useful for developing a multi-lingual site), so I can't vouch for how the others will behave. If anyone else feels like sharing their experiences, please do so!
How are templates executed?
According to that article,
Ahah, I thought, all I need to do now is check the variables and methods of the JDocument class in the joomla API (JDocument Class), and I'll have a nice list of variables and methods available through the $this object from within a template index.php file.J!Documentation wrote:Templates are executed in the context of the document object so that the $this object is always the instantiation of the JDocument class.
While those would seem to be usable variables and methods, I also noticed that it doesn't mention the ubiquitous $baseurl variable that every template uses to link to stylesheets and images and the like. As it turns out, that variable is assigned in the render() method of the JDocumentHTML class (around line 217 of /libraries/joomla/document/html/html.php), which is the method responsible for "Outputting the template to the browser." In that method, the $this->template variable (the name of the directory containing the current template) and the $this->baseurl variable are both assigned, as well as a $this->params object, which is generated from the params.ini file of your current template.
So, the full list? Well, if you want to mess with methods, I suggested reading up on the JDocument Class on your own and trying to figure them out, but the list of variables (accessible from the $this object) is as follows, as far as I can tell (all are strings, unless otherwise noted):
Code: Select all
$this->baseurl;
$this->template;
$this->params; // Template specific params object -- defined in the params.ini file
// From JDocument:
$this->base; // Document base URL -- redundant, as far as I can tell
$this->description; // Document description
$this->direction; // Contains the document direction setting (default='ltr')
$this->language; // Contains the document language setting (default='en-gb')
$this->link; // Document full URL
$this->title; // Document title
$this->_generator; // Document generator (default='Joomla! 1.5 - Open Source Content Management')
-
- Joomla! Fledgling
- Posts: 3
- Joined: Wed Aug 19, 2009 10:27 pm
Re: Joomla Variables
ddmobley wrote:Is there a document that has all the available variables one could use in building customer templates? I would think having a template variable definition document would make a lot of sense.
http://docs.joomla.org/Constants
i'm sure there are more, but these are some