Hello, I am working on theming this site. This content type in particular is giving me problems.
http://neilcjones.alissajones.com/personal-work/stephen-crane/two-or-thr...
I created a content types called "personalwork". It has CCK fields for the image, the credit, the poem title, poem author. The poem itself uses the body field.
Problem #1: Is there a way to remove the title off the page? I was hoping it could be done in the node-personalwork.tpl.php, but it appears that page.tpl.php is generating it. I want the title to remain for all other content types, but do not want it for personalwork content type.
Problem #2: I want to get the credit information ("Two or Three Angels, Digital, 2007, 15 x 15 in"...surrounded in a blue border right now) to be under the image and have the other text to the right. See jpg here: http://studentpages.scad.edu/~aliash20/lttlalis_design.jpg
How can I do this? I tried to create a block with Views for the image and the credit. Thinking I could tell the content type to not show it, and have the block show it instead. Then I could theme the block to float left. I couldn't get this to work, because it pulls the images and credit from ALL personalwork content. I do not know how to filter the content for just the active page. Can this be done with Views? Or do I need to edit tpl.php files? Or is there a way to theme it without adding markup to a tpl.php?
I am using a Zen subtheme.
If editing tpl.php files is the best solution, can you point me to some favorite tutorials? I have only barely gotten into editing tpl.php files and still have a lot to learn about them.
Thank you for any help you can provide.
Comments
hmm, so is this just not
hmm, so is this just not possible to do with Views or tpl.php? Has anyone done anything like this (two columns in a content area) through theming? I was trying various floating ideas, but I'm really needing a DIV tag around the image and the credit. Let me know if you have any suggestions. Thanks again if to anyone who can offer their ideas.
Hi there - 1) Your title
Hi there -
1) Your title might be printing from inside page.tpl.php. Try wrapping the
<?php print $title ?>in an if statement that checks the node type:<?php if ($node->type != 'personalwork'): ?><?php print $title ?>
<?php endif; ?>
2) Is your view set up as a list view or node view? If it is a list view, you can adjust the order in which they print. If you put the credits last in that last, you can use CSS to clear the image so that block of text prints below the image. There is a div around the the caption:
.field-field-credit-- does that work for you?Thanks mndonx! Wrapping that
Thanks mndonx! Wrapping that statement worked perfectly! I guess I will have to keep working on the two column issue. Right now, I am not using a view, but instead having the actual node come up. I thought I could use a block (created from Views) to help get the text I want wrapped in code, but I can't figure out how to get the block to filter out the content to just the content for the active page. Right now, it pulls from all of the personalwork content types.
Thanks for the help! One issue down:)
Ah, I see - it isn't a view.
Ah, I see - it isn't a view. If it is just the plain node, I think you could reorganize the order of elements from the Content Type (Manage Fields) so that the credits are last. Then use CSS to clear the image.
Let me know if that works.
Like @mndonx said
Like @mndonx said reorganizing the content in mange fields and CSS can probably accomplish what you want. To really have granular control over the code you'd want to use a tpl.php though.
Just duplicate node.tpl.php from your theme or /modules/node/node.tpl.php
From there use a simple print_r($node) to see all the options you have to choose from and lay them out as you wish in the tpl.php.
Doing a quick Google search looks like this tutorial could help you with that side of it:
http://www.alldrupalthemes.com/drupal-blog/theming-cck-node
----
Kevin Basarab
http://kbasarab.com | http://jacksonville.com
Thank you @mndonx and Kevin.
Thank you @mndonx and Kevin. That helped a lot. The tutorial was clear and I got it pulling the text so that I can add markup for theming in the tpl.php. Thanks!
You might also consider the
You might also consider the panels module for #2