By Kriskaido on
Hi,
I'd like to access each piece of content of my drupal installation, not just the big blocks like $content or $sidebar_left.
Is there a place which lists every "sub" variable somewhere in the Drupal documentation ?
Otherwise, what PHP code could I use to display it ?
I tried print_r($sidebar_left) but it doesn't seem to work ...
How can I go deep into those variables and arrays ?
Any tip ?
Kris.
Comments
One solution... I guess... ^_^
Hey Kris... I kind of new in this too...
but try this...
I use Macromedia Dreamweaver so what I do is search for the variable and/or the command... y the entire page.... so the results show me where this words are located... and then try to understand what its mean... and how it works... it works for me...
just try...
***PD: I don't know how to do that in any other program but in dreamweaver... just find your way to get it...***
I hope it helps you...
Found something
Hi Ricardo,
As usual, I send my questions a bit too early ...
For example, $sidebar_left displays a series of blocks. So each time it finds a block (managed through the admin interface), it includes block.tpl.php. In that file, type something like
print_r($block)to see the block's content.Kris.
Seeking $sidebar_left
I see others struggled months ago, but no solution is posted. Is this a black hole?
I have searched all the Drupal code for $sidebar_left. I see where it is used, but not where it's value is set.
SCREENSHOT
Here is a screenshot showing all the occurrences of $sidebar_left... do you see where it's value is assigned?
http://www.danallen.com/drupal_$sidebar_left.jpg
I must be missing something obvious.. it is like it comes out of nowhere. I am assuming I am missing something obvious...
Any explanation for how $sidebar_left gets its value would be extremely much appreciated.
Best regards,
Dan Allen
p.s. I do have a lead.. I saw where values ending up in $sidebar_left are read out of the database.. must be in there the value of $sidebar_left gets set, but then I don't see this in the search for $sidebar_left.
If I figure this out, I will post the solution. Otherwise, any pointers will be appreciated. Thanks again.
template engine
The template engine is responsible for setting the variables, In the case of the phptemplate engine it sets the variables available to the various *,tpl.php files. If you visit "PHPTemplate theme engine" in the handbook and visit the various links to common tpl.php files you will find variables that are set by default. You may also want to visit "Making additional variables available to your templates", Also the file phptemplate.engine (under themes/engines/phptemplate) is the file that sets the variables (You do not really want to change that file though as it would make upgrade hard, instead see the previous reference)
Thank you
Exactly what the doctor ordered. Thank you very much.
Still Looking for Basic Concepts
I am en route to the phpTemplate engine and the documentation noted by nevets.
In case there is a quick way to answer my next question, I am taking a shot at posting it here.
I have mocked up the site I want to implement with Drupal. If possible, I would like to have the login form located away from the left sidebar, but still use the sidebar/menu systems in Drupal.
Site Mockup Online
This link will show you the basic look / function I am trying to achieve:
http://montpelierlife.com/zDogDesigns/montlife.htm
What is the basic approach to setting this up in Drupal? Specifically:
1. Menu across the top, under the banner
2. On the side, I need the sidebar menu, without the login form. The menu does not need to do any tree effects (no expansion and collapsing), just keep the list as it looks on the mock up.
3. When a user clicks on the top menu items, or an item in the directory (left side bar), it should bring up a page similar to the home page, except the stories should all be tagged to go with the selected category, and the ads need to be able to change. Stories need to be in many categories.
Any informaton/comments will be appreciated.
Best regards,
dallenvt