Lets say I have this view, that has a simple listing:

  1. Title
  2. body, trimmed
  3. Thumbnail image from post

Now, Im trying to remove as much of views markup clutter as I can. I added a class to the view, lets say, class="listing". Afterwards, I changed the field wrapper for the title, place it as an H3 with a class="list-title", removed the html wrapper. Now we have a nice and clean title. Did the same with the body, trimmed it to 100 characters, set the field wrapper as a p, removed the html wrapper, and target it through the parent. So I have:

.listing {}
.listing-title {}
.listing-p {}

So far so good. Now: the image has a style and is set to link to its node, and now its where it gets tricky. I cannot give a class to the < a > tag surrounding the img element. I've removed the field wrapper and the html wrapper, because I dont need them. I think adding a span that has the < a > and the < img > inside its too much.

Ideally I would have classes for what I have to target like so:

.listing {}
.listing-title {}
.listing-image {}
.listing p {}

So, can one add a class through views UI, to the < a > surrounding the < img >?

See the attachment for my example.

CommentFileSizeAuthor
niceX(.png42.37 KBbetovarg

Comments

betovarg’s picture

Issue summary: View changes

Simple corrections

mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)