SageCell linked cells
Documentation
The "About" section of the SageCell website home page
has these paragraphs:
SageMathCell project is an easy-to-use web interface
to a free open-source mathematics software system SageMath.
It allows embedding Sage computations into any webpage:
check out short instructions or
comprehensive description of capabilities.
with the following links:
That "comprehensive description of capabilities" page
has a section dedicated to your question:
which says
When multiple input locations are given, this sets whether
the code from these cells is to be executed from the same
kernel, so that code executed in one will affect the
execution of code from another cell:
{ ..
linked: boolean
.. }
This option is false
by default.
So try using linked: true
.
Examples
Many pages online use SageCell with linked cells.
PreTeXt is an authoring system allowing,
in addition to (or instead of) a pdf version of documents, to produce
an html version with executable code cells, using SageCell.
The PreTeXt home page links to a few examples, including:
which has a page about using Sage via SageCell:
See in particular
which conveniently has several cells.
Try typing a = 2
in the first one, executing (by hitting Shift
+Enter
or by clicking the "Execute" button) and then typing a^2
in the second one
and executing.
Check the source code of that page and search the word "linked" there
(e.g. using cmd-F or ctrl-F).
For many more example, see the PreTeXt gallery
or the PreTeXt catalog.