Page MenuHome

Introducing shortcode parsing API
Closed, ResolvedPublic


It all started with this: a useful feature in a blog is having the capability to introduce a "Read more..." breakpoint into a blog article. This way, when the post is displayed (for example in the Blender Cloud frontpage) there is more control on the amount of content displayed. Introducing this kind of elements in a post or other content is not very uncommon.

Proposed functionality

Introduce shortcodes parsing on content (similarly to how attachment parsing currently works), so that we can insert elements such as [breakpoint]. Possibly we could support attributes as well, like [youtube src=''].

Proposed implementation

Create an API where shortcodes and the way are parsed is defined programmatically (base shortcode class, with various attrs).

Feedback is welcome.



Event Timeline

Francesco Siddi (fsiddi) lowered the priority of this task from Needs Triage by Developer to Normal.Jan 19 2018, 11:57 AM
Francesco Siddi (fsiddi) created this task.

Awesome idea. I was also thinking about something for Scripting for Artists, to have a way to include the slides only for subscribers. Maybe something like [iframe src='xxx' cap='subscriber']?

This cap='subscribers' could also be used for embedding multiple YouTube videos in the same node, but for susbcribers only.

Awesome indeed! Not only solves the YouTube, Vimeo, SoundCloud whitelisting issue, but we could also embed our own Blender Cloud assets as well! Done in the extension app (blender-cloud) I guess, not Pillar.

Development is being developed in my shortcodes branch .

Sybren A. Stüvel (sybren) closed this task as Resolved.Apr 3 2018, 4:02 PM

It's in master + live in production. Production database has also been migrated to the new schema and all nodes have had their empty attachments dicts removed.