From 066b9af7e4421307b8c5d8a9341d33ca87f68b48 Mon Sep 17 00:00:00 2001 From: Manushi Majumdar Date: Fri, 23 Jan 2026 16:47:55 -0500 Subject: [PATCH 1/3] cloning and editing storymaps guide 2/4 --- .../cloning-editing-storymap.ipynb | 1002 +++++++++++++++++ 1 file changed, 1002 insertions(+) create mode 100644 guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb diff --git a/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb b/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb new file mode 100644 index 0000000000..1df87c279d --- /dev/null +++ b/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb @@ -0,0 +1,1002 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "ca1bbd97-7991-4c33-a880-daa69bf66e9b", + "metadata": {}, + "source": [ + "## Cloning and Editing StoryMaps" + ] + }, + { + "cell_type": "markdown", + "id": "502d0308-61e7-468b-ac84-0b41b6968695", + "metadata": {}, + "source": [ + "In this guide we will walk through the process of cloning a storymap within our organization and to another organization. We will then edit the cloned story and copy selective content elements from the cloned story to the original story. We have a separate [Introduction to StoryMaps](../introduction-to-storymaps) guide that covers the various content elements that can be added to a StoryMap." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "8a18767f-4d43-4ae6-9eaf-5aa435e47932", + "metadata": {}, + "outputs": [], + "source": [ + "from arcgis.gis import GIS\n", + "from arcgis.apps import storymap\n", + "from arcgis.apps.storymap import StoryMap, Themes, Cover\n", + "from arcgis.apps.storymap.story_content import Image, Image360" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "3eaf17c4-80d1-40e5-b310-e4ade23c7194", + "metadata": {}, + "outputs": [], + "source": [ + "gis = GIS(profile='your_online_profile')" + ] + }, + { + "cell_type": "markdown", + "id": "bfbe9ac4-58ac-47d7-b345-2ea385e4190b", + "metadata": {}, + "source": [ + "We fetch the StoryMap item we would like to clone. " + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "c9174b34-f634-4b69-9343-96fcf8de6b63", + "metadata": {}, + "outputs": [], + "source": [ + "storymap_item = gis.content.get('7860d45d35f6455193576933206d8352')" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "5b246ad6-93a1-4a24-9a47-2d2cb40fe7bf", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature Themed Story\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: January 23, 2026\n", + "
0 comments, 0 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "https://storymaps.arcgis.com/stories/7860d45d35f6455193576933206d8352" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_story = StoryMap(storymap_item)\n", + "my_story" + ] + }, + { + "cell_type": "markdown", + "id": "c49cd026-e83c-42f5-b0af-1848874cc0eb", + "metadata": {}, + "source": [ + "### Duplicating a StoryMap\n", + "\n", + "The `duplicate()` method supported specifically for `StoryMap` items lets you create a copy or _shallow_ clone of your StoryMap. It retains the structure, text and layout of the original story but does not clone the items within the original story and retains references to the maps, layers, and other items from the original story. The `duplicate()` method is a powerful way to create a copy of your story within the same organization. " + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "2427d5e7-e9e4-44b0-81db-da87ec4dfc52", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Duplicated nature story 1\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: January 23, 2026\n", + "
0 comments, 0 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "duplicated_story = my_story.duplicate(\"Duplicated nature story 1\")\n", + "duplicated_story" + ] + }, + { + "cell_type": "markdown", + "id": "e0f25d99-0e94-47bf-84ef-0c3d80309a00", + "metadata": {}, + "source": [ + "On the other hand, if you wish to clone this story while also cloning the deep dependencies (e.g., maps, layers, tables) from the original story, you may want to use the `clone_items()` method of the ArcGIS API for Python which is beneficial to clone any and all ArcGIS items. \n", + "\n", + "This technique is particularly potent to clone the StoryMap and its dependencies to another organization, as shown in the example that follows. " + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "22742240-91b9-4b80-a9ff-915146221d3d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[,\n", + " ]" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_story_online = gis.content.clone_items([storymap_item], copy_data=True)\n", + "cloned_story_online" + ] + }, + { + "cell_type": "markdown", + "id": "3ad89c1b-5592-4459-9e7b-02912c04252e", + "metadata": {}, + "source": [ + "As we see above, unlike the `duplicate()` method that created a copy of the StoryMap item alone, `clone_items()` has successfully cloned both the StoryMap and Web Map items. " + ] + }, + { + "cell_type": "markdown", + "id": "7992a440-8be7-4838-b763-1d0f72de3805", + "metadata": {}, + "source": [ + "#### Cloning to ArcGIS Enterprise" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "82029365-f924-4a92-8524-b4cdfbd93b61", + "metadata": {}, + "outputs": [], + "source": [ + "gis_enterprise = GIS(profile='your_enterprise_profile')" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "218e0101-1b90-4704-97ef-832232681cfa", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[,\n", + " ]" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_story_ent = gis_enterprise.content.clone_items([storymap_item])\n", + "cloned_story_ent" + ] + }, + { + "cell_type": "markdown", + "id": "e2c5eba9-a02c-4314-87b8-d3f2185afeeb", + "metadata": {}, + "source": [ + "`clone_items()` has cloned both the items to the ArcGIS Enterprise organization as well. " + ] + }, + { + "cell_type": "markdown", + "id": "36279668-d7b7-4d86-b84d-7c001024e409", + "metadata": {}, + "source": [ + "### Editing the StoryMap\n", + "\n", + "We will now make edits to certain aspects of our cloned story. You can make edits to update the branding elements of the Storymap, as we will see below. \n", + "\n", + "Additionally, you can make edits to update the content elements. This can be particularly useful when you have a Storymap for a certain region and you want to clone it to retain the structure and layout but only update the text or maps or media within the story." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "568dccd1-6d47-4963-b400-2b229ac20328", + "metadata": {}, + "outputs": [], + "source": [ + "cloned_storymap = StoryMap(cloned_story_online[1])" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "f6b50210-9747-40e2-a72d-958911fa85c6", + "metadata": {}, + "outputs": [], + "source": [ + "img = Image(\"https://www.nps.gov/npgallery/GetAsset/69680c29-caa3-42da-93d9-32925e9ed409/proxy/hires\")" + ] + }, + { + "cell_type": "markdown", + "id": "d34b65a4-da5e-4f0b-b659-ea204bdca58b", + "metadata": {}, + "source": [ + "#### Cover" + ] + }, + { + "cell_type": "markdown", + "id": "f6a93dca-21e6-4ed6-9670-a5ed7f536d30", + "metadata": {}, + "source": [ + "The cover is what you see at the start of your StoryMap. This cover can set the visual tone of the StoryMap.\n", + "\n", + "We will update necessary attributes for the cover." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "8dca405b-892e-4f9b-bfaa-e0f0100d4a74", + "metadata": {}, + "outputs": [], + "source": [ + "cover = cloned_storymap.contents[0]\n", + "cover.title = \"Nature Story\"\n", + "cover.summary = \"Nature themed StoryMap\"\n", + "cover.byline = \"Python Story\"\n", + "cover.media = img" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "4e433677-a564-43d9-a870-8837e750dd82", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature Themed Story\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: January 23, 2026\n", + "
0 comments, 1 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.save()" + ] + }, + { + "cell_type": "markdown", + "id": "63a7fb9c-c5da-497c-9a28-25b4b642271a", + "metadata": {}, + "source": [ + "Having saved this story, we now see the cover updated." + ] + }, + { + "cell_type": "markdown", + "id": "b2398132-0a72-4d56-957f-beae92d27cad", + "metadata": {}, + "source": [ + "![updated_cover](https://github.com/user-attachments/assets/a439a9be-2154-4e87-9262-6551cbe2aa5e)" + ] + }, + { + "cell_type": "markdown", + "id": "46b12ca5-c550-4ddb-b91b-d18113c6fe95", + "metadata": {}, + "source": [ + "#### Logo\n", + "\n", + "Similarly you can also update the logo of the story." + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "1cd0475d-d85e-4ff0-97ea-187847afde75", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.set_logo('D:/Github Projects/geosaurus/tests/resources/storymap/storymap_image_river.jpg')" + ] + }, + { + "cell_type": "markdown", + "id": "13aa02c9-f3a5-42b6-bb5d-e41ccbc9a282", + "metadata": {}, + "source": [ + "#### Theme\n", + "\n", + "Theme sets the visual style and appearance of the storymap. You can fetch and update the theme of your story as shown below. \n", + "\n", + "Supported type enumerations for theme include:\n", + "* `SUMMIT` = \"summit\"\n", + "* `OBSIDIAN` = \"obsidian\"\n", + "* `RIDGELINE` = \"ridgeline\"\n", + "* `MESA` = \"mesa\"\n", + "* `TIDAL` = \"tidal\"\n", + "* `SLATE` = \"slate\"" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "829df8eb-c940-4908-9f01-1c98dc8dd6a4", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'summit'" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.get_theme()" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "2571daa4-9977-419e-b049-126185c93f02", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.theme(Themes.OBSIDIAN)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "8ed6985f-9dd8-467b-84cc-e3a27708a05b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature Themed Story\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: January 23, 2026\n", + "
0 comments, 2 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.save()" + ] + }, + { + "cell_type": "markdown", + "id": "51a9dd4b-751d-4d3f-a008-ce1e9446778e", + "metadata": {}, + "source": [ + "The theme of the story has been successfully updated.\n", + "\n", + "![theme_update](https://github.com/user-attachments/assets/3cfcc0bd-1039-4d8c-9dc6-73497dbf424c)" + ] + }, + { + "cell_type": "markdown", + "id": "81cf0a3b-544c-48f3-9dd0-fe7c7b35267b", + "metadata": {}, + "source": [ + "#### Credits\n", + "\n", + "Credits represent the attribution section in a story. Credits are found at the end of the story and thus are always the last node." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "2dad1652-0eb2-48c0-92d3-bde4431de9b6", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['n-9087a8']" + ] + }, + "execution_count": 19, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.credits(content=\"Nature story\" , attribution=\"ArcGIS API for Python\", heading=\"Nature themed story\", description=\"Generated through Python\")" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "c86c254d-a332-44d0-b867-30b8678b3481", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['n-GYl04j', 'n-386ede', 'n-477910']" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_story.credits(content=\"Nature story\" , attribution=\"ArcGIS API for Python\", heading=\"Nature themed story\", description=\"Generated through Python\")" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "8faf8899-37ee-4f7c-8e91-8527fc901df4", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature Themed Story\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: January 23, 2026\n", + "
0 comments, 2 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.save()" + ] + }, + { + "cell_type": "markdown", + "id": "45829418-8056-43bd-b461-083ff4de31ae", + "metadata": {}, + "source": [ + "This has successfully updated the credits towards the end of the story.\n", + "\n", + "![credits](https://github.com/user-attachments/assets/bfde90a6-fb4b-44ce-82d6-55f44e887db1)" + ] + }, + { + "cell_type": "markdown", + "id": "89275dd5-4631-42a6-8bc0-8b898f6cfe59", + "metadata": {}, + "source": [ + "#### Editing text\n", + "\n", + "Let us look at a final example where we update some text within the cloned story." + ] + }, + { + "cell_type": "markdown", + "id": "2176b536-28c2-4500-9d86-8c9825b97372", + "metadata": {}, + "source": [ + "We identify the particular content element with text we would like to update by providing the index of that content element to the `contents` property of the StoryMap." + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "28357554-b875-4778-b0a3-5fb4b7d78a22", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Nature themed story'" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "content = cloned_storymap.contents[3]\n", + "content.text" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "56a065ff-2992-4176-83ba-ad49ac7a5c83", + "metadata": {}, + "outputs": [], + "source": [ + "content.text = 'Flora and Fauna story'" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "f9467b19-9822-4e29-878c-ad55a202dc67", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature Themed Story\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: January 23, 2026\n", + "
0 comments, 2 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.save()" + ] + }, + { + "cell_type": "markdown", + "id": "591e6f54-2264-4944-a7dc-457e2227a71c", + "metadata": {}, + "source": [ + "![updated_text](https://github.com/user-attachments/assets/43c111ab-a5fd-47f7-b68a-55e8e7665f37)" + ] + }, + { + "cell_type": "markdown", + "id": "bf69d67e-7013-44db-86e4-c231337c700b", + "metadata": {}, + "source": [ + "#### Adding a new map to my Storymap" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "id": "854d9204-526b-406d-9a93-c99d9ea1a4ec", + "metadata": {}, + "outputs": [], + "source": [ + "map1 = gis.content.get('7f39672ef7f6469db7b2bbd383349fc1')\n", + "map1_for_storymap = storymap.Map(map1)" + ] + }, + { + "cell_type": "code", + "execution_count": 39, + "id": "e4d305bf-b7c6-46ca-9082-23bb70f1b367", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 39, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.add(content = map1_for_storymap, caption = \"Natural Beauty in UK\", position = 4)" + ] + }, + { + "cell_type": "code", + "execution_count": 41, + "id": "16ad7c6d-bd90-4a1d-96b2-df140ad8d780", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature Themed Story\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: January 23, 2026\n", + "
0 comments, 2 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 41, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.save()" + ] + }, + { + "cell_type": "markdown", + "id": "7769c95a-6f4a-4a45-a83d-c07cdd2e8e03", + "metadata": {}, + "source": [ + "![map](https://github.com/user-attachments/assets/dd855eb3-e202-44d7-bf39-a7784b1e46bc)" + ] + }, + { + "cell_type": "markdown", + "id": "b637f5ce-f584-40bb-8d79-03d2f0f2c265", + "metadata": {}, + "source": [ + "### Copy selective content over to a another Storymap\n", + "\n", + "The ArcGIS API for Python also allows for copying selective sections of a StoryMap over to another using the [`copy_content()`](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#arcgis.apps.storymap.story.StoryMap.copy_content) method if you do not wish to clone all the content of a StoryMap. \n", + "\n", + "This capability can be beneficial in a few cases. \n", + "1. You may have cloned an existing story, updated it with a few more content elements and would like to copy those over back to the original StoryMap.\n", + "2. You may already have another StoryMap item that you would like to update with content from your existing StoryMap, without cloning it and creating another item.\n", + "\n", + "We will explore the second use-case through an example below. \n", + "\n", + "Note: If you wish to copy all the content elements of a StoryMap, you need to ensure that you are not copying the `Cover`, `Navigation` and `Credits` of one story over to another. We will see how to remove those elements before copying below." + ] + }, + { + "cell_type": "code", + "execution_count": 51, + "id": "1163765d-c075-4543-9a0f-b4eb2ef5de59", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[Image360(image='storymap_image_river.jpg'),\n", + " Text(text=Flora and Fauna story),\n", + " Map(item='7f39672ef7f6469db7b2bbd383349fc1', type='Web Map'),\n", + " Image(image='https://www.nps.gov/npgallery/GetAsset/69680c29-caa3-42da-93d9-32925e9ed409/proxy/hires'),\n", + " ImageGallery(num_images=3),\n", + " Separator(),\n", + " Audio(path='rocks.mp3'),\n", + " Video(path='https://www.youtube.com/embed/8wY14zHDmEs'),\n", + " Sidecar(num_slides=1),\n", + " Swipe(type='image'),\n", + " 'Credits']" + ] + }, + "execution_count": 51, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "content = cloned_storymap.contents[2:]\n", + "content" + ] + }, + { + "cell_type": "markdown", + "id": "2a5cce35-3d28-42f4-9ced-0bff966644fa", + "metadata": {}, + "source": [ + "Filtering the contents from index 2 and onwards removes the `Cover` and `Navigation`. We now remove the `Credits`. " + ] + }, + { + "cell_type": "code", + "execution_count": 52, + "id": "dac8c2a3-56a0-4660-97e4-399d5c1b18e2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'Credits'" + ] + }, + "execution_count": 52, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "content.pop(-1)" + ] + }, + { + "cell_type": "markdown", + "id": "76b86805-14d8-45f5-a704-861b37703d2c", + "metadata": {}, + "source": [ + "We fetch the StoryMap to which we would like to content copy over." + ] + }, + { + "cell_type": "code", + "execution_count": 55, + "id": "b97885e2-b92b-48e9-a91b-66f3f9f6eb14", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " StoryMap via Python\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: January 23, 2026\n", + "
0 comments, 1 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "https://storymaps.arcgis.com/stories/2c1eb8f9a4c44b3ea6ed2af554f394a2" + ] + }, + "execution_count": 55, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "python_story = gis.content.get('2c1eb8f9a4c44b3ea6ed2af554f394a2')\n", + "python_storymap = StoryMap(python_story)\n", + "python_storymap" + ] + }, + { + "cell_type": "code", + "execution_count": 54, + "id": "8cabf5fa-cd05-48eb-b3a2-3ba17389d89b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 54, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "cloned_storymap.copy_content(target_story = python_storymap, node_list = content)" + ] + }, + { + "cell_type": "markdown", + "id": "5d0fe1d3-1c1d-403b-959f-d364cab34e1f", + "metadata": {}, + "source": [ + "Ensure that you save the `target_story` after copying content into it for the changes to reflect in the story. " + ] + }, + { + "cell_type": "code", + "execution_count": 56, + "id": "ae808d7f-9359-4524-a47c-a297e1376fdb", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " StoryMap via Python\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: January 23, 2026\n", + "
0 comments, 1 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 56, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "python_storymap.save()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.11" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From a30b62356bb20a18d9f6f48fccbfa6e8c6e28359 Mon Sep 17 00:00:00 2001 From: Manushi Majumdar Date: Wed, 28 Jan 2026 00:48:55 -0500 Subject: [PATCH 2/3] requested changes --- .../cloning-editing-storymap.ipynb | 53 ++++++------------- 1 file changed, 17 insertions(+), 36 deletions(-) diff --git a/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb b/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb index 1df87c279d..773baf7c42 100644 --- a/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb +++ b/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb @@ -104,7 +104,7 @@ "source": [ "### Duplicating a StoryMap\n", "\n", - "The `duplicate()` method supported specifically for `StoryMap` items lets you create a copy or _shallow_ clone of your StoryMap. It retains the structure, text and layout of the original story but does not clone the items within the original story and retains references to the maps, layers, and other items from the original story. The `duplicate()` method is a powerful way to create a copy of your story within the same organization. " + "The `duplicate()` method supported specifically for `StoryMap` items lets you create a copy or _shallow_ clone of your StoryMap. It retains the structure, text and layout of the original story but does not clone the items within the original story and retains references to the maps, layers, and other items from the original story. The `duplicate()` method is a powerful way to create a copy of your story within the __same organization__. " ] }, { @@ -152,42 +152,11 @@ "id": "e0f25d99-0e94-47bf-84ef-0c3d80309a00", "metadata": {}, "source": [ - "On the other hand, if you wish to clone this story while also cloning the deep dependencies (e.g., maps, layers, tables) from the original story, you may want to use the `clone_items()` method of the ArcGIS API for Python which is beneficial to clone any and all ArcGIS items. \n", + "On the other hand, if you wish to clone this story while also cloning the deep dependencies (e.g., maps, layers, tables) from the original story, you will need to use the [`clone_items()` method](https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis.ContentManager.clone_items) of the ArcGIS API for Python. \n", "\n", "This technique is particularly potent to clone the StoryMap and its dependencies to another organization, as shown in the example that follows. " ] }, - { - "cell_type": "code", - "execution_count": 8, - "id": "22742240-91b9-4b80-a9ff-915146221d3d", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[,\n", - " ]" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "cloned_story_online = gis.content.clone_items([storymap_item], copy_data=True)\n", - "cloned_story_online" - ] - }, - { - "cell_type": "markdown", - "id": "3ad89c1b-5592-4459-9e7b-02912c04252e", - "metadata": {}, - "source": [ - "As we see above, unlike the `duplicate()` method that created a copy of the StoryMap item alone, `clone_items()` has successfully cloned both the StoryMap and Web Map items. " - ] - }, { "cell_type": "markdown", "id": "7992a440-8be7-4838-b763-1d0f72de3805", @@ -234,7 +203,7 @@ "id": "e2c5eba9-a02c-4314-87b8-d3f2185afeeb", "metadata": {}, "source": [ - "`clone_items()` has cloned both the items to the ArcGIS Enterprise organization as well. " + "`clone_items()` has successfully cloned both the the StoryMap and Web Map items to the target ArcGIS Enterprise organization. " ] }, { @@ -246,7 +215,7 @@ "\n", "We will now make edits to certain aspects of our cloned story. You can make edits to update the branding elements of the Storymap, as we will see below. \n", "\n", - "Additionally, you can make edits to update the content elements. This can be particularly useful when you have a Storymap for a certain region and you want to clone it to retain the structure and layout but only update the text or maps or media within the story." + "Additionally, you can make edits to update the content elements. This can be particularly useful when you have a template Storymap and you want to clone it to retain the structure and layout but only update the text or maps or media within the story." ] }, { @@ -447,6 +416,14 @@ "cloned_storymap.theme(Themes.OBSIDIAN)" ] }, + { + "cell_type": "markdown", + "id": "a40ea08e-13ec-44f7-b6cc-8eb634355cce", + "metadata": {}, + "source": [ + "It is necessary to save the `StoryMap` to see our changes reflect there." + ] + }, { "cell_type": "code", "execution_count": 18, @@ -699,7 +676,11 @@ "id": "bf69d67e-7013-44db-86e4-c231337c700b", "metadata": {}, "source": [ - "#### Adding a new map to my Storymap" + "#### Adding a new map to my Storymap\n", + "\n", + "We now fetch the map item that we would like to include in this story. Having imported the `storymap` submodule previously, we can directly access the `Map` class within it, specific for StoryMap content, as shown below. \n", + "\n", + "You can learn more about the other supported StoryMap content elements from [this introductory guide](../introduction-to-storymaps). " ] }, { From 9a831ca4ad4dbc9a0726f93e42d2c60bcb6e8182 Mon Sep 17 00:00:00 2001 From: Manushi Majumdar Date: Wed, 28 Jan 2026 01:16:10 -0500 Subject: [PATCH 3/3] updated theme visual --- .../cloning-editing-storymap.ipynb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb b/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb index 773baf7c42..e533fe7c63 100644 --- a/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb +++ b/guide/13-managing-arcgis-applications/cloning-editing-storymap.ipynb @@ -363,15 +363,19 @@ "source": [ "#### Theme\n", "\n", - "Theme sets the visual style and appearance of the storymap. You can fetch and update the theme of your story as shown below. \n", + "Theme sets the visual style and appearance of the StoryMap. ArcGIS StoryMaps supports the following themes:\n", "\n", - "Supported type enumerations for theme include:\n", + "![themes](https://github.com/user-attachments/assets/8f1cc448-cc6a-4e87-8734-7351d04a9e47)\n", + "\n", + "The ArcGIS API for Python supports these themes through type enumerations which include:\n", "* `SUMMIT` = \"summit\"\n", "* `OBSIDIAN` = \"obsidian\"\n", "* `RIDGELINE` = \"ridgeline\"\n", "* `MESA` = \"mesa\"\n", "* `TIDAL` = \"tidal\"\n", - "* `SLATE` = \"slate\"" + "* `SLATE` = \"slate\"\n", + "\n", + "You can fetch and update the theme of your story as shown below." ] }, {