The "Content item" widget allows you to place a single node on another page. This can be a useful way of reusing content in a limited way!

However, there are a couple of use cases when you may want to set the title:

  1. When showing fields from the node, you may want to give it some kind of title, like "Featured article"
  2. Or when showing the full node, you may want to use a different title than the full node, maybe something shorter to fit on a home page

The first use case is simple - we just enable title overrides on the View. The second is a little more complicated because it's actually rendering the node, so we need to inject the overridden title into the node at the correct point.

I'll upload a patch in a moment which does this!

Comments

dsnopek’s picture

Status: Active » Needs review
StatusFileSize
new2.09 KB

Attached is my first pass at a patch!

dsnopek’s picture

Here is a patch to add tests for this functionality. I'm not sure if any update functions are necessary, I'll try to use the upgrade tests on Travis-CI to find out.

EDIT: Here's the Travis build: https://travis-ci.org/dsnopek/panopoly/builds/50085987

dsnopek’s picture

StatusFileSize
new2.9 KB

Not sure why the old content item test works locally, but fails on Travis! I suspect it has to do with the autocomplete on the "Piece of content" field, so I'm switching the order that the fields are filled in so that focus moves away and the autocomplete is aborted.

EDIT: New build on Travis: https://travis-ci.org/dsnopek/panopoly/builds/50089513

  • dsnopek committed 0a48e3f on 7.x-1.x
    Updated Panopoly Widgets and Test for Issue #2421569 by dsnopek: Allow...
dsnopek’s picture

Status: Needs review » Fixed

The tests on Travis-CI are looking good! Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.