Thanks,
That was a helpful tip.
Right now the issue I have with Drupal (actually, not so much with Drupal but with the information about it) is that many articles on the web on how to do stuff with it are seemingly either incomplete or inconsistent.
I'm sure this is part of the steep learning curve associated with learning any new software architecture.
I'm planning to completely overhaul my popular devotional web site called The Vine (www.thevine.co.nz) using Drupal. This presents many challenges but I'm convinced Drupal is the right tool for the job.
The first challenge I've set myself is to understand and present the most efficient way for users to create and update their accounts and public profiles. Then I want to allow users to create buddy lists and send/receive private messages.
Right now, I'm just trying to get my head around how to theme nodes and pages.
Actually, one specific challenge is to add a CCK field to the Account page to allow users to suspend email delivery until a specific date in the future. I know this will require a hook, but where to start??
I'm hoping the good folk on this site will help lead me in redeveloping The Vine web site.
Blessings,
Steve
I'm looking at my user profile page at DrupalSN (http://drupalsn.com/user/kiwi) and wondering how on earth to replicate this design. What is the approach they took I wonder?
The page seems to be constructed using Blocks, but how are the blocks composed? Are they made using Views?
And what about the profile photo? Is that a block too?
Is the entire page made using a template file, is so is it based on a node type?
I'm using D6 and desperately trying to get my head around all this. Seems like Drupal has a long way to go to make it more accessible to beginners.
Steve
The website you're looking at is using Quicktabs for the user content stuff. I haven't used that module but you could probably just use the php function on a block and use content_profile_load to get the information you want for each tab.
For the durpal projects, they use a block generated by views. Then Buddylist.
In your user-profile.tpl.php they defined user_profile_left and user_profile_right for the content.
I do like their layout.
Thanks again BishopBooyah,
I used Firebug to examine the layout of the page and noticed that much of the content was positioned using blocks. I understand how this part is done -- no problems here.
What confuses me is how the user profile picture is placed within the "user_profile_left" region. This appears to be the only element of the page that is not in a block.
In D6 regions are defined by the .info file, right? If this is the case, then how would you define these "user_profile_XXX" regions *just* for "user-profile.tpl.php" and then how would you assign the photo to the region -- is it done via code or some other means?
Thanks,
Steve
To someone who has worked alot with Drupal I'm sure your answer makes a lot of sense, but without code examples this is not clear at all to me.
How do you modify user-profile.tpl.php to add new regions?
How do you use content_profile_load() to get the information?
I know these questions might seem annoying and basic, but there are other Drupal newbies out there like me to who all this stuff has an aura of mystery around it.
Steve
Humm, there are about a million ways to do the same thing in Drupal. So welcome to Drupal!
Without doing much research, I'd probably start off with copying their template and putting it in my user-profile.tpl.php file:
<div class="profile">
<div class="floatleft user_profile_left">
<?php print $content_profile_stuff ?>
</div>
<div class="floatleft user_profile_right">
<div id="my_content_block">
<?php print $content_block ?>
</div>
<div id="my_views_block">
<?php print $myviews_block ?>
</div>
<div id="my_buddylist_block">
<?php print $mybuddylist_block ?>
</div>
</div>
</div>Then in my template.php file I can define those variables and do a little Drupal voodoo:
<?php
function mytheme_profile_preprocess_node(&$v) {
// Note: I like using $v instead of $variables because it's shorter
// Get the users variable
global $user;
// Load the content_profile stuff
$mycontent_profile_stuff = content_profile_load("profile", $user->uid);
// Create the variable that will be printed out in user-profile.tpl.php
// Use node_view so that Drupal runs the content_profile data through
// the filters and your node-profile.tpl.php file
// Your node-profile.tpl.php file will basically theme your content stuff
// and that data will be returned via node_view
$v['content_profile_stuff'] = node_view($mycontent_profile_stuff, FALSE, TRUE, FALSE);
// You can use module_invoke to force the block into existence,
// but this goes around the configure blocks interface that
// you see in drupal
// If you want to modify how the output of the views block,
// create a views-view--myviewsname--block.tpl.php
// see drupal.org/node/352970
$get_views_block = module_invoke('myviews_block_name', 'block', 'view', 0);
// Create the variable for your user-profile.tpl.php
$v['myviews_block'] = $get_views_block['content'];
// Do the same thing for buddylist
$get_buddylist_block = module_invoke('mybuddylist_block_name', 'block', 'view', 0);
// Create the variable for your user-profile.tpl.php
$v['mybuddylist_block'] = $get_buddylist_block['content'];
?>I haven't checked the code, but hopefully that'll get you started. Get and install the devel module, it'll be your best friend, especially if you need to do any theming. Also, devel provides several functions, my favorite is dsm($variable) which spits out the content of $variable in a very nice, very readable way.
I'm a relative newbie to Drupal.
I'm trying to create a custom user profile template. I've added the Content Profile module and created a few new fields (first name, last name, etc..). Next, I created a user-profile.tpl.php template, the problem now is figuring out how to access the custom fields within this template.
Doing a var_dump($user); or var_dump($account); does not reveal these custom fields.
So, how do I access these fields?
Thanks,
Steve