By volongoto on
Hi,
How can I display a field twice within a node (in Drupal 7)? There is an image field in one of my content types and I would like to display that same image both at the top and bottom of the "post". Is this possible?
Thanks in advance.
Comments
Create a tpl file for that content type
Create a tpl file for that content type (node-content-type.tpl.php) and add code something like this:
Format the tpl according to your website template.
Note: in display filelds tab of content type, hide the image field from being displayed.
Regards,
Sundar
Thank you
Thank you for your response. I'll try this and report back.
Displaying a location twice -- once as address and once as GMap
Thank you for the response. I see why it works perfectly well in volongoto's case; however, I am hoping that someone might be able to a similar issue - but with a wrinkle.
I am similarly trying to display the same field twice -- in my case it's a location rather than an image -- and the second time I display the location I want to display it as a GMap. I've had no trouble getting the GMap working. Ordinarily to show both the address and map I would just set the location's display setting to "Address with map", but I want the address as the second in the sort order and the map as the sixth (of seven) in the sort order in my content type.
(Important Note! I played with displaying the map as a views block, which in turn seemed inconvenient for a couple of reasons. First, it kept showing up showing up in the 'Edit' portion for a given piece of content, when I only wanted in the 'View' portion. Second it's less convenient organizationally since it's a separate block and the other content flow is managed under the 'Manage Display' page for the content type. There is a good chance I'm overlooking something here.)
Any help is much appreciated!
woop
I have an image field
I have an image field (multiple) and wanted to display the first one at the top of the article and all images (slideshow) at the bottom of article. I was expecting some way with DS but couldn't find.
Solved my problem using Display Suite
I just found it was possible with Display Suite code field with a little tweaking into code. What I did,
The field was available at Manage display tab of my content type i.e. admin/structure/types/manage/[Content type]/display which I easily placed where I wanted.
You can also skip out on the
You can also skip out on the php code by creating 'dynamic display' field using the display suite module.
@dan_lennox, thanks for this
@dan_lennox, thanks for this tip! It worked nicely for me. One thing to add... you must "Select A Layout" in the display for the content type in question. Once you do that, the custom field you created will show up, as will the buttons that will allow you to create more custom fields directly from that page.
@dan_lennox @hockey2112
@dan_lennox @hockey2112 thanks, works great...
Not obvious : thank you !
Not obvious : thank you !
Michael Lessard
webmaster of Quebec City "democracy in action" media