By anphil on
Hi everyone. I have a problem I was hoping someone could help me with. I have a theme which has a box on the right for content, and also on the left is a smaller box with details about what's on the page. Sort of a summary. The problem is I have no idea how to make both these boxes editable. The client wants to be able to edit either box. How can I create 2 content areas or make both these spots editable? Any help would be greatly appreciated. Thanks!
Just so you can see my template so far, it is at http://www.andrewsphillips.com/drupal
Comments
Custon content type?
Could you make a special content type and have an abstract field? Then have a special node template that would put the content of the abstract on the left side. You might need Content Template module.
So I'm part way there.
So I'm part way there. Thanks for the suggestion, it's helped and I think I now understand the basic principle of how this works. Does anybody know how to use CCK and contemplate to put content into an existing div? Basically I have created 2 fields. First is a summary field and second is body field. When they enter text in the summary field, I want that text to be placed in an existing div in my page on the left. When they enter content in the body, I want it to be placed in an existing div on the right of my page. Does anybody know how to do this? Thanks a lot guys!
CCK
CCK creates the content type.
Contemplate allow you to create how the date from CCK is put into a page. When you go to the body section you will see the standard output code. You can take these or the variables and place them in your template. When you see the variables, you will see what they output. This makes picking the correct piece of code easy.
With Contemplate you can format the teaser, the content, and the RSS feed. You can take these variables and apply them to your template if necessary.
So when I go into
So when I go into contemplate, in the body section this is the code:
So if I just take
<?php print $node->field_body[0]['view'] ?>and paste that into the appropriate div it should print what is in the body there?Edited by: VeryMisunderstood; Added code tags so HTML isn't rendered or stripped
Yes
Yes, that should print the body content. Then in the other div you place the code for the abstract - field_summary.
Do I need to take the code
Do I need to take the code out of contemplate and just have it in the page.tpl.php? Or leave it in?
So I've got that done and it
So I've got that done and it worked! Thanks to everyone for the help! Quick question though, when I submit a page, it now puts "Submitted by anphil at date and time" at the top of my page. Anyone know how to get rid of that?
You can remove it from your
You can remove it from your template or go to the theme configuration page at admin/build/themes/settings and turn it off for your content type. Look for "Display post information on"
Use Panels for multiple content areas in Drupal
I've not yet used it myself, but the answer to your problem seems to be the panels module:
http://drupal.org/project/panels
I'm aware it's an oldish issue, but thought this would help anyone else hitting on this thread.
Martin