WordPress.org

Making WordPress.org

Opened 16 months ago

Closed 3 weeks ago

#1751 closed enhancement (fixed)

Allow Sponsor Shortcode to show excerpt, image only, or the_content

Reported by: Kenshino Owned by: coreymckrill
Milestone: Priority: normal
Component: WordCamp Site & Plugins Keywords: dev-feedback has-patch needs-testing
Cc:

Description

Right now the sponsor shortcode shows the_content and the title itself is not linked (check https://2016.singapore.wordcamp.org/sponsors/, you'll have to inspect to see the hidden title output)

The problem with this is that some sponsors are gonna have huge chunks of text and some aren't. So it's gonna look unequal, plus no one reads through that amount of text.

An excerpt will give us a good control of what to display on the archive page for sponsors. And the single page will allow people who actually want to read about them - to ... well do so.

I propose that the shortcode should do the following

  • Allow excerpt=$length (length being a character limit that possibly hooks into excerpt_length filter, and when this is on, the_content is not ran)
  • Allow both excerpts and content to be hidden to only show the sponsor image.

If it makes sense, I'll happily submit a patch :)

Attachments (2)

1751-sponsors-alt.diff (1.0 KB) - added by Kau-Boy 5 weeks ago.
1751.diff (2.8 KB) - added by Kau-Boy 5 weeks ago.

Download all attachments as: .zip

Change History (9)

#1 @iandunn
16 months ago

  • Type changed from defect to enhancement

Allow excerpt=$length (length being a character limit that possibly hooks into excerpt_length filter, and when this is on, the_content is not ran)
Allow both excerpts and content to be hidden to only show the sponsor image.

@andreamiddleton, I'm not entirely clear on the details of how the Community Team wants this to work.

  • Should pages like https://2016.singapore.wordcamp.org/sponsors/ only show an excerpt of the sponsor description, rather than their full blurb? If an attendee wanted to read the full description, then they would click on the sponsor's name, and be taken to their individual page (e.g., https://2016.singapore.wordcamp.org/sponsor/woocommerce/)
  • If so, should that be the only option, or should there also be an option to show the full description on pages like https://2016.singapore.wordcamp.org/sponsors/ ? If there are options, which one should be the default?
  • Should organizers determine the excerpt length, or should that be hard-coded? If so, what should the length be? The default in WordPress is 55 words.
  • Should there be an option to hide the excerpt, so that only the sponsor logo is shown?

Here's some counts on some current sponsors:

WooCommerce: 178 words, 1195 characters
Jetpack: 66 words, 459 characters
GoDaddy: 62 words, 416 characters
Bluehost: 78 words, 469 characters
WPML: 94 words, 602 characters

xref https://wordpress.slack.com/archives/events/p1465198114000016

#2 @Kenshino
15 months ago

  • Keywords needs-patch added

Adding context here from the discussion we had

https://wordpress.slack.com/archives/events/p1465226141000028

#3 @Kau-Boy
5 weeks ago

  • Keywords has-patch needs-testing added; needs-patch removed

I am currently at WordCamp Brightin Contributor Day and we found out, that the image is not using an alt attribute. So when you hide the content on the listings page, as we did for WordCamp Europe, screen readers will see no text (except headlines with sponsor levels) on the page. I've written a patch to add the sponsors title as the alt attributes text (1751-sponsors-alt.diff).

I also though about some of the points mentioned here about using excerpts instead of the full content. SO I came up with an idea, where you can be more fexible in how to design the page and also provide links to the single sponsors posts.

Currently, there is onyly one attribute link with the values none (default) and website which will link to the sponsors external website. There is no option to link to the single sponsors post with the shortcode.

My second patch will add some new attributes (or values):

link

The default value none will not link the title and logo. The current value website will link both to the external sponsor website. The new value post will link both to the single sponsors post.

title

The default value visible will, show the h3 with the sponsors title, linked accordingly to the link attribute

content

The default value full will print the content. The value excerpt will print the first 55 words of the content, adding a "continue reading" (with hidden screen reader title) at the end. Any other value, like none, will hide the content, so only the logo and/or title will the shown.

excerpt_length

Sets the words to be used in the excerpt.

@Kau-Boy
5 weeks ago

This ticket was mentioned in Slack in #meta-wordcamp by coreymckrill. View the logs.


4 weeks ago

This ticket was mentioned in Slack in #meta-wordcamp by kau-boy. View the logs.


4 weeks ago

#6 @coreymckrill
3 weeks ago

In 5853:

WordCamp Sponsors: Add alt attribute to logo images in shortcode output

Props Kau-Boy
Refs #1751

#7 @coreymckrill
3 weeks ago

  • Owner set to coreymckrill
  • Resolution set to fixed
  • Status changed from new to closed

In 5854:

WordCamp Sponsors: Additional parameters for the shortcode

This adds or updates the following parameters in the [sponsors]
shortcode:

link

The default value none will not link the title and logo. The current
value website will link both to the external sponsor website. The new
value post will link both to the single sponsors post.

title

The default value visible will show the h3 with the sponsors title,
linked accordingly to the link attribute. Other values will omit the
title.

content

The default value full will print the content. The value excerpt
will print the first 55 words of the content, adding a "continue
reading" (with hidden screen reader title) at the end. Any other value,
like none, will hide the content, so only the logo and/or title will
be shown.

excerpt_length

Sets the number of words to be used in the excerpt (default is 55).

Props Kau-Boy
Fixes #1751

Note: See TracTickets for help on using tickets.