I created my own content type. I would like to further customize it by adding columns. I installed the module panel. Can I use the same panel layout to include my content type? Also, how do I put a picture in a field of the panel?
2 Answers
I would use panels for layout of a page which contains various bits and pieces from other pages. For layout of the display of a single page or node type I would edit the templates page--content-type.tpl.php and node--content-type.tpl.php.
In node--content-type.tpl.php you could then do something like:
<div class="col1">
<?php
// Hide fields so that we can render them later.
hide($content['field_image_main']);
print render($content);
?>
</div>
<div class="col2">
<?php print render($content['field_image_main']);?>
</div>
-
yes, but my main problem is to insert an image into a frame of a panel.– AntilopeJul 5, 2012 at 8:48
-
My feeling is that you should not be using panels for single node layout. Could you perhaps explain the need for panels? Jul 5, 2012 at 9:08
-
Yes, I want to add a content type within my layouts are always different, they have various columns on the sides with different content. (images / articles that I chose on the content type)– AntilopeJul 5, 2012 at 9:12
Following your previous comments, it seems like you want Display Suite rather than Panels.
Display Suite allows you to take full control over how your content is displayed using a drag and drop interface. Arrange your nodes, views, comments, user data etc. the way you want without having to work your way through dozens of template files. A predefined list of layouts (D7 only) is available for even more drag and drop fun!
There's also an absolutely cracking series of video tutorials here that will help you set it up and configure it.
-
If I use display suite can put the fields in regions that have previously created? If so, how?– AntilopeNov 14, 2012 at 23:39