The Joomla! Forum ™





Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 20 posts ] 
Author Message
 Post subject: Joomla Variables
PostPosted: Fri Jun 16, 2006 4:37 am 
Joomla! Intern
Joomla! Intern

Joined: Thu Jun 15, 2006 2:18 am
Posts: 90
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.


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Sat Jul 22, 2006 1:26 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Sep 13, 2005 6:36 pm
Posts: 12
No kidding.  I definitely second this.  Is there any info on what variables are available from a template?


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Sat Jul 22, 2006 2:23 pm 
Joomla! Intern
Joomla! Intern

Joined: Thu Jun 15, 2006 2:18 am
Posts: 90
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.


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Mon Sep 04, 2006 9:25 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Sep 04, 2006 9:23 am
Posts: 1
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...


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Sun Sep 10, 2006 8:48 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Sep 08, 2006 12:29 pm
Posts: 7
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.


Agree!!!

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


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Wed Nov 05, 2008 12:28 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Dec 25, 2006 2:30 pm
Posts: 10
I agree too. I'm desperately looking for a couple of hours now for such a thing - HELP!!!


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Wed Nov 05, 2008 5:33 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Apr 24, 2008 10:11 pm
Posts: 189
Location: Inland Empire, California, USA
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.


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!

_________________
http://OnTheMarkDesign.com

Joomla! Community Magazine Team Member


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Wed Nov 05, 2008 6:30 am 
Joomla! Guru
Joomla! Guru

Joined: Thu Aug 18, 2005 10:51 pm
Posts: 697
Location: Austria
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!

As i understood the former postings, they are newbies.
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


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Wed Nov 05, 2008 7:18 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Oct 19, 2008 6:29 pm
Posts: 10
Location: USA
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

_________________
Mambo was great joomla looks to be better


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Wed Nov 05, 2008 6:42 pm 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Apr 24, 2008 10:11 pm
Posts: 189
Location: Inland Empire, California, USA
mic wrote:
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!

As i understood the former postings, they are newbies.
So how they can start a (new) documentation?
But it seems that you are knowing more about - why not you?


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.

_________________
http://OnTheMarkDesign.com

Joomla! Community Magazine Team Member


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Thu Nov 06, 2008 10:05 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Dec 25, 2006 2:30 pm
Posts: 10
OnTheMarkDesign wrote:
mic wrote:
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!

As i understood the former postings, they are newbies.
So how they can start a (new) documentation?
But it seems that you are knowing more about - why not you?


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.


I thank you, good people, for your efforts.


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Fri Nov 07, 2008 2:33 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Apr 24, 2008 10:11 pm
Posts: 189
Location: Inland Empire, California, USA
effectus wrote:

I thank you, good people, for your efforts.


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.

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.

_________________
http://OnTheMarkDesign.com

Joomla! Community Magazine Team Member


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Fri Nov 07, 2008 3:01 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Apr 24, 2008 10:11 pm
Posts: 189
Location: Inland Empire, California, USA
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.


Template FAQ's from Joomla Documentation might be a place to start!

_________________
http://OnTheMarkDesign.com

Joomla! Community Magazine Team Member


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Sun Nov 09, 2008 12:16 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Dec 25, 2006 2:30 pm
Posts: 10
@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?


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Sun Nov 09, 2008 4:58 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Thu Apr 24, 2008 10:11 pm
Posts: 189
Location: Inland Empire, California, USA
effectus wrote:
@OnTheMarkDesign: Thanks for your work - looking forward to it.
Appreciate the comment. It will take some time to "accumulate" the variables. Fortunately, Joomla comes with 2 front end templates, and 1 admin. template.

Quote:
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?


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.

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!

_________________
http://OnTheMarkDesign.com

Joomla! Community Magazine Team Member


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Sun Nov 09, 2008 1:44 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Dec 25, 2006 2:30 pm
Posts: 10
OnTheMarkDesign 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.


Got those 2 books myself :laugh:

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 !


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Sun Nov 09, 2008 3:13 pm 
User avatar
Joomla! Ace
Joomla! Ace

Joined: Thu Aug 18, 2005 8:57 am
Posts: 1376
Location: Shrewsbury, Shropshire, United Kingdom
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.

_________________
Joomla Leadership Team - Production Working Group

Joomla Web Services http://www.kickstarter.com/projects/964120480/joomla-web-services
Lion Coppice http://www.lioncoppice.org


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Mon Nov 10, 2008 12:14 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Dec 25, 2006 2:30 pm
Posts: 10
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.


Great news, Chris. Really nice to see the progress Joomla is making - and these documentation news are a great example.

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!


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Fri May 29, 2009 4:42 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri May 29, 2009 3:50 pm
Posts: 23
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,
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.


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.

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:
$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')

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!

_________________
http://www.acusti.ca


Top
 Profile  
 
 Post subject: Re: Joomla Variables
PostPosted: Wed Aug 19, 2009 10:41 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Wed Aug 19, 2009 10:27 pm
Posts: 3
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 20 posts ] 



Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group