2

I have a custom field that is an unordered list that I want to be placed under a static title and to the left of an advertisement. I only want this to show on article pages, but right now I can't seem to figure out how to place the custom field where I want it to be placed. I know a module is required, but what I am asking is if anyone can give me the correct hooks or whatever to retrieve the custom field information, so I can place it where needed.

2 Answers 2

4

Copy node.tpl.php of your theme and name it node--article.tpl.php. In this file create the html structure you like. In this file you have access to the individual fields.

<?php print render($content['field_customfieldname']); ?>

will print out content of your custom field. Wrap this filed with html id or class and style it with css. (I am assuming you are working with a non core theme)

2

I'm a big proponent (and co-maintainer) of the Panels module, which gives you a UI where you can arrange your fields. It takes work to learn how to use it, but it's well worth it in my opinion. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.