0
votes

I created a content type called Online Dealers which has three fields: title, image and URL. I need to somehow customize how this data is being displayed in my View. I am using the Custom Text field to control the layout of my page content. Right now, when I put the [field_dealer_list] in my Custom Text field for my View, it spits out everything like this: screenshot of current display of online dealer listing.

I need it to look like this: screenshot of correct display of online dealer list

I have tried to mess with all sorts of settings and can quite get what I need.

Is this possible to do?

Thanks! Lisa

3

3 Answers

0
votes

I would recommend swapping out the Custom Text field for the actual fields of the content type. In your View choose all the fields you want to show:

Show fields

Then you can go into each field and edit their settings.

For the title you can wrap it in a paragraph tag.

Title Field

Then, for the URL (I'm guessing the URL is just a plain old textfield) - hide it from being displayed. (We're going to rewrite the image field to have the url linked around it).

URL field

And finally for the image field rewrite the output to link it.

image field

This will give you an unordered list with the title in a paragraph tag and the image wrapped in the url in a list item. You can then go ahead and style that list.

For what it's worth, I've done a quick test on simplytest.me - https://r02ga.ply.st/, the username and password should already be filled in and you should see the View I created in there. Let me know if you can't see this - it should be up for another 21 hours.

This should solve your problem but there are many many ways to do this. Usually I would already have the markup from a front end developer and I would use the 'Manage Display' settings on the content type and set the Views' format to show 'Content', then I'd use the 'Theme Information' (Under Advanced in Views) to overwrite the Views markup in my theme. BUT that seems like overkill for your problem but it's worth looking into if you choose to do any advanced Drupal theming.

0
votes

Thank you for responding sjhuda. I think this would work expect I can't quite get rid of my Custom Text since as I am using that to custom display my entire page.

This is a screenshot of my View here and the field Dealer List is what is displaying the data that is showing up here. So not sure how I can break out the data from the Dealer list field which has the title, image, URL for each online dealer available for that product and break it out into custom HTML? Sorry if I could be confusing. I am new at Drupal :-).

0
votes

Sorry, I can't comment on your answer because I don't have enough 'reputation' (I'm assuming you had the same problem). So apologies for another 'answer'.

Have you tried creating a new display in Views? That way you can have the View in the screenshot as your 'Default' display then have another display rendering that block. Assuming your current display is Page? I'd recommend adding a new 'Block' display.

Add new block display

You can then go and remove/edit the fields you don't require for just this 'Block' display.

Block display fields