Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By patbranch on
I have a custom content type (portfolio_img) consisting of a title field and image field. I'm displaying them in a view with flexslider pulling in both fields. I made a custom .tpl for this view so I could display the title field in another region (than the main content region). I'm confused what I need to add it. Do I need the portfolio_img's field's machine name or is there a separate machine name for the field render by the view? Is what I'm adding to a region (below) right?
print render(field_view_field('node', $node, 'views_field_title_field'));
Comments
RE: Displaying View Field Manually Via tpl
Create a view block with the field you need & Flexslider module. This will then appear in admin->structure->blocks. place that block in particular region. No need of custom tpl file for this.
Let me know in case of any query/concern regarding this.
Thanks!
Thanks for the reply Deepali
Thanks for the reply Deepali_Agarwal!
That is actually the first way I did it, but I ended up having sync issues between the main view and field as block. Using the left/right/pause controls (among other things) would throw off the slideshow even though I had the description flexslider profile linked to the image one.
Here's what it looks like (description on left as block like you suggested in this screenshot). https://www.flickr.com/photos/_pat/20252114059/in/dateposted-public/
override your view tpl file
First override your view tpl file and then
Thanks vinoth.babu!
Thanks vinoth.babu!
This is what I have now which is currently giving me an error.
Do I need the portfolio_img's field's machine name or is there a separate machine name for the field rendered by the view?
These are the errors:
Hi please print the values in
Hi please print the values in "foreach" loop then find your value whether its coming or not . Please check the below code