Closed
Bug 1428181
Opened 8 years ago
Closed 8 years ago
Allow EmbedLiveSample to be given an "extra" section from which to get code
Categories
(developer.mozilla.org Graveyard :: General, enhancement)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: sheppy, Unassigned)
Details
(Keywords: in-triage, Whiteboard: [specification][type:change])
What feature should be changed? Please provide the URL of the feature if possible.
==================================================================================
Let's update EmbedLiveSample and the underlying live sample system code to allow an "extra" section to be specified, from which extra code is pulled, modifying the syntax to:
{{EmbedLiveSample(sampleBlockID, frameWidth, frameHeight, screenshotURL, slug, frameClassName, extraBlockID)}}
What problems would this solve?
===============================
This would help simplify situations in which we reuse the same code across multiple examples on a page. Currently, we have to duplicate that code (using a "hidden" class wrapper) to accomplish this, which can lead to problems if changes need to be made.
Basically, this would simplify the creation of sets of related examples (such as a series of examples that build upon each other, or which use the same CSS). In addition, it would reduce the chance that a problem gets fixed in one sample but not others because of duplicated code.
Who would use this?
===================
Live sample contributors
What would users see?
=====================
No noticeable difference but likely smaller and potentially slightly faster-loading pages since we wouldn't have to duplicate as much code.
What would users do? What would happen as a result?
===================================================
Users would do nothing new. Contributors could simply refer to the block that contains the shared code in the "extraBlockID" parameter to EmbedLiveSample, and that code would be bundled into the live sample along with the rest.
Is there anything else we should know?
======================================
We have a growing number of pages with samples sharing code like this; being able to do it more intelligently would be helpful.
Comment 1•8 years ago
|
||
In my opinion, the already overly complex "live sample" system shouldn't be extended.
We should deprecate it and use interactive examples on GitHub.
Updated•8 years ago
|
Updated•6 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•