diff --git a/guide/13-managing-arcgis-applications/storymap-briefings.ipynb b/guide/13-managing-arcgis-applications/storymap-briefings.ipynb new file mode 100644 index 0000000000..7b3a5b4456 --- /dev/null +++ b/guide/13-managing-arcgis-applications/storymap-briefings.ipynb @@ -0,0 +1,1041 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "d6a9d27e-eb8d-48e8-85ca-e0a16ce0c224", + "metadata": {}, + "source": [ + "## Introduction to Briefings (ArcGIS StoryMaps)\n", + "\n", + "Using the ArcGIS API for Python you can build [Briefings in ArcGIS StoryMaps](https://learn.arcgis.com/en/paths/getting-started-with-briefings-in-arcgis-storymaps/). Briefings offer a slide-based output ideal for delivering presentations that integrate maps and data from your organization. You can now create elegant and interactive slide-based presentations called briefings for succinct storytelling and offline sharing with ArcGIS StoryMaps. " + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "80ee349f-f60d-479e-a6ec-f2d6d72055e1", + "metadata": {}, + "outputs": [], + "source": [ + "from arcgis.gis import GIS\n", + "from arcgis.apps import storymap\n", + "from arcgis.apps.storymap import Briefing, Themes, Text, TextStyles, Image, BriefingSlide, SlideLayout, Map" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "1fd881a8-484b-4d72-a7d8-6e8cb5a427a7", + "metadata": {}, + "outputs": [], + "source": [ + "gis = GIS(profile='your_online_profile')" + ] + }, + { + "cell_type": "markdown", + "id": "f458e254-3653-4f78-9041-34d2a736357d", + "metadata": {}, + "source": [ + "ArcGIS StoryMaps enable users to add content through various content type elements. The following content element types are supported within the ArcGIS API for Python. \n", + "\n", + "* [Image](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#image)\n", + "* [Image360](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#image360)\n", + "* [Video](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#video)\n", + "* [Audio](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#audio)\n", + "* [Embed](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#embed)\n", + "* [App](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#app)\n", + "* [Map](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#map)\n", + "* [Text](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#text)\n", + "* [Button](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#button)\n", + "* [Gallery](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#gallery)\n", + "* [Swipe](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#swipe)\n", + "* [Sidecar](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#sidecar)\n", + "* [Timeline](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#timeline)\n", + "* [MapTour](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#maptour)\n", + "* [Places](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#places)\n", + "* [Code](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#code)\n", + "* [Table](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#table)\n", + "* [ExpressMap](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#expressmap)\n", + "* [Infographic](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#infographic)\n", + "* [Navigation](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#navigation)\n", + "* [Cover](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#cover)\n", + "* [Separator](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#separator)\n", + "\n", + "Specific to Briefings, the following content elements are additionally supported:\n", + "* [Briefing](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#briefing)\n", + "* [BriefingSlide](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#briefingslide)\n", + "* [Block](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#block)" + ] + }, + { + "cell_type": "markdown", + "id": "508effbe-360c-4074-9a31-d7a6cadac2d0", + "metadata": {}, + "source": [ + "We will start by creating a `Briefing` and then updating the `Cover` and `Theme` for this Briefing. " + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "91b76e7c-9dff-4efe-8568-9a19259c74ac", + "metadata": {}, + "outputs": [], + "source": [ + "my_briefing = Briefing()" + ] + }, + { + "cell_type": "markdown", + "id": "691577f1-7c6f-498c-99ea-f8c56152d098", + "metadata": {}, + "source": [ + "The `Cover` is the first slide in the briefing. We will update necessary properties such as a `title`, `summary` etc. of the cover slide and we define the `Image` below that we would like to include on the cover slide." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "2b0c9b04-3519-492f-a793-0f4d6da7a6fd", + "metadata": {}, + "outputs": [], + "source": [ + "img = Image(\"https://www.nps.gov/npgallery/GetAsset/69680c29-caa3-42da-93d9-32925e9ed409/proxy/hires\")" + ] + }, + { + "cell_type": "markdown", + "id": "77e1cc7d-4fca-4ec5-a5aa-f338b6124e15", + "metadata": {}, + "source": [ + "A key thing to note in the cell below is that each slide of the `Briefing` can be accessed via the `slides` property of the `Briefing` using the index of the slide. The first slide (index = 0) will always be the cover slide, and we access it as follows:" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "fb1fd38e-501a-4d4f-b2d7-e669adf89e31", + "metadata": {}, + "outputs": [], + "source": [ + "cover = my_briefing.slides[0].cover" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "ccdd188c-e99a-48b8-9fb5-5a21639f66d1", + "metadata": {}, + "outputs": [], + "source": [ + "cover.title = \"Nature Presentation\"\n", + "cover.summary = \"Briefing about nature created programmatically\"\n", + "cover.by_line = \"Nature Briefing\"\n", + "cover.media = img" + ] + }, + { + "cell_type": "markdown", + "id": "f20d742d-07fa-43fa-90f8-4c5a7e45f471", + "metadata": {}, + "source": [ + "#### Themes \n", + "\n", + "Theme sets the visual style and appearance of the briefing. ArcGIS StoryMaps supports the following themes:\n", + "\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\"\n", + "\n", + "You can fetch and update the theme of your briefing as shown below." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "6217344d-c57b-4647-9b56-0b9f0f445ed4", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_briefing.theme(Themes.SLATE)" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "e2f4ba54-445b-42a8-8552-41562301d13b", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 8, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_briefing.set_logo('D:/Github Projects/geosaurus/tests/resources/storymap/storymap_image_river.jpg')" + ] + }, + { + "cell_type": "markdown", + "id": "e536ae50-bbe2-4eef-a27d-f301932dc681", + "metadata": {}, + "source": [ + "We will now save this Briefing and verify these updates. Since we are saving this for the first time, we provide a suitable `title` in the `save()` method. \n", + "\n", + "It is important to `save()` the Briefing (without `title` parameter) everytime you make changes or add new slides. This method helps update the item with your desired changes." + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "98099b78-7d3f-4f87-ac03-07e76edbf5f4", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature themed Briefing slides\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: February 05, 2026\n", + "
0 comments, 0 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_briefing.save(title = \"Nature themed Briefing slides\")" + ] + }, + { + "cell_type": "markdown", + "id": "837f3c04-ddce-4663-912b-8e30c908e30c", + "metadata": {}, + "source": [ + "![cover](https://github.com/user-attachments/assets/1c80f060-285e-46a8-aee0-d82cc552f74b)\n", + "\n", + "We have successfully updated the Cover or opening slide of the Briefing. " + ] + }, + { + "cell_type": "markdown", + "id": "f37309ed-b92c-4a1e-86ea-6fbc2b62316a", + "metadata": {}, + "source": [ + "### Concept of slides and blocks\n", + "\n", + "Similar to traditional presentations with slides, `Briefing`s come with `BriefingSlide`s to add structured content to your Briefing.\n", + "\n", + "Each slide within has one or more blocks, and the number of blocks need to be specified during slide creation using the `num_blocks` parameter. A block represents a section that holds individual content elements. \n", + "\n", + "We start by creating three slides below." + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "a92538dd-7c88-4c77-a034-952ae5c49e2c", + "metadata": {}, + "outputs": [], + "source": [ + "new_slide = BriefingSlide(layout=SlideLayout.FLEXIBLE, num_blocks=1)\n", + "slide1 = my_briefing.add(slide=new_slide)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "id": "62cfcb07-9566-42fc-a59f-c779d96460fb", + "metadata": {}, + "outputs": [], + "source": [ + "new_slide = BriefingSlide(layout=SlideLayout.FLEXIBLE, num_blocks=2)\n", + "slide2 = my_briefing.add(slide=new_slide)" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "1f451cc0-5c03-4ccb-a2f0-50527963b9ac", + "metadata": {}, + "outputs": [], + "source": [ + "new_slide = BriefingSlide(layout=SlideLayout.SINGLE)\n", + "slide3 = my_briefing.add(slide=new_slide)" + ] + }, + { + "cell_type": "markdown", + "id": "17ad8a51-70e7-4b95-aba9-5192b0624d24", + "metadata": {}, + "source": [ + "### Adding text to a block in a slide\n", + "\n", + "You can add `Text` to your Briefing by providing the text string of choice to the`text` parameter of this [Text class](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#text).\n", + "\n", + "You can also specify the `style` you would like to render your text in, using the following [`TextStyles` enumeration](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#arcgis.apps.storymap.story_content.TextStyles) values supported in the ArcGIS API for Python.\n", + "\n", + "* BULLETLIST = 'bullet-list'\n", + "* NUMBERLIST = 'numbered-list'\n", + "* HEADING = 'h2'\n", + "* SUBHEADING = 'h3'\n", + "* HEADING1 = 'h2'\n", + "* HEADING2 = 'h3'\n", + "* HEADING3 = 'h4'\n", + "* PARAGRAPH = 'paragraph'\n", + "* QUOTE = 'quote'\n", + "\n", + "\n", + "Our first slide has one block. We will update it with a heading and a text summary of the contents of this `Briefing`." + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "3ae8aff5-b88c-4ab9-b426-b38a87371614", + "metadata": {}, + "outputs": [], + "source": [ + "block_1 = slide1.blocks[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "c7faf1ea-641e-497c-9de6-b1b68152893b", + "metadata": {}, + "outputs": [], + "source": [ + "heading = Text(\n", + " text=\"Contents\",\n", + " style=TextStyles.HEADING,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "id": "b42c950a-d259-4e7a-b8a3-2f691f7fc0ee", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Text(text=Contents)" + ] + }, + "execution_count": 15, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "block_1.add_content(heading)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "bc660ae4-0463-434f-95e3-0b59397706db", + "metadata": {}, + "outputs": [], + "source": [ + "quote = Text(\n", + " text=\"This Briefing will have images related to nature, and a map about the coverage of Forests in the US.\",\n", + " style=TextStyles.QUOTE,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "104bb391-e384-4f7f-bf5e-46db064db402", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Text(text=This Briefing will have images related to nature, and a map about the coverage of Forests in the US.)" + ] + }, + "execution_count": 17, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "block_1.add_content(quote)" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "id": "638807de-fda4-4067-8cdb-9dc0f86c4570", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature themed Briefing slides\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: February 05, 2026\n", + "
0 comments, 0 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 22, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_briefing.save()" + ] + }, + { + "cell_type": "markdown", + "id": "7be3828d-9f64-4398-b68b-4bc0b5022a20", + "metadata": {}, + "source": [ + "The first slide is successfully updated with text. \n", + "\n", + "![text](https://github.com/user-attachments/assets/43a8bb11-2e3f-4f2f-a108-3091a48de404)" + ] + }, + { + "cell_type": "markdown", + "id": "3e5d6945-c33a-4895-91bf-955aab1407f4", + "metadata": {}, + "source": [ + "### Add images to blocks in a slide\n", + "\n", + "Our second slide has two blocks. Let's add images to each of those blocks. " + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "id": "62602c2d-bd82-4121-890b-a3dfc8eea747", + "metadata": {}, + "outputs": [], + "source": [ + "block1 = slide2.blocks[0]\n", + "block2 = slide2.blocks[1]" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "id": "eaf69ddb-f632-45e0-8970-f56bdd3a82bf", + "metadata": {}, + "outputs": [], + "source": [ + "image1 = Image(\n", + " \"https://www.nps.gov/npgallery/GetAsset/36106ED0-1DD8-B71C-07ED73544EA246C7/proxy/hires\"\n", + ")\n", + "image2 = Image(\n", + " \"https://www.nps.gov/npgallery/GetAsset/0022D3FF-1DD8-B71B-0BE3AD4C48F96FF9/proxy/hires\"\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "id": "0db4a47d-3479-44a7-97ad-ea252c93e8bd", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Image(image='https://www.nps.gov/npgallery/GetAsset/0022D3FF-1DD8-B71B-0BE3AD4C48F96FF9/proxy/hires')" + ] + }, + "execution_count": 20, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "block1.add_content(image1)\n", + "block2.add_content(image2)" + ] + }, + { + "cell_type": "markdown", + "id": "1f38f0fd-7340-4773-906e-fd8da39ded76", + "metadata": {}, + "source": [ + "We can also set a `title` to the slide using the property." + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "id": "d7eea429-4f0a-485b-a178-021aeaf2f5f5", + "metadata": {}, + "outputs": [], + "source": [ + "slide2.title = \"Visual Glimpses\"" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "id": "49d8264b-0d49-4185-829f-1eef5123ec44", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature themed Briefing slides\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: February 05, 2026\n", + "
0 comments, 0 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 23, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_briefing.save()" + ] + }, + { + "cell_type": "markdown", + "id": "86b4a9b6-2c6f-4d94-ab24-315cb0a5c287", + "metadata": {}, + "source": [ + "Our briefing has now updated the two blocks with images.\n", + "\n", + "![image1](https://github.com/user-attachments/assets/1d59d8e1-2087-41f9-8f2f-17f31590b638)" + ] + }, + { + "cell_type": "markdown", + "id": "db7ac1e2-7f4c-4c74-bb48-d909e6656c74", + "metadata": {}, + "source": [ + "### Adding a Map to a block in a slide\n", + "\n", + "We will now fetch a map item and add it to the third slide.\n", + "\n", + "> Note: We are fetching an item of type `Web Map`, and then invoking the Storymap `Map` content class to add the item as a `Map` to our briefing. " + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "id": "e2277d72-810d-4123-a3b9-69e03ad4fedd", + "metadata": {}, + "outputs": [], + "source": [ + "map1 = gis.content.get('dd3e4259b7434f1ebd488c09a8611ddf')\n", + "map1_for_storymap = storymap.Map(map1)" + ] + }, + { + "cell_type": "markdown", + "id": "b45014a1-e601-432b-b95b-81a5ee5bcd37", + "metadata": {}, + "source": [ + "We will add the map to a block in the third slide. Following that we will se another pattern for setting the title of this slide." + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "id": "5e79e925-bca9-4089-94a0-f3f99e3f2aac", + "metadata": {}, + "outputs": [], + "source": [ + "block_3 = slide3.blocks[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "6a09110a-b5dc-41fc-b168-f7d4e457af0a", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "Map(item='dd3e4259b7434f1ebd488c09a8611ddf', type='Web Map')" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "block_3.add_content(map1_for_storymap)" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "id": "4efc1db7-2a8a-4e5a-abee-f611c0385951", + "metadata": {}, + "outputs": [], + "source": [ + "slide3.title = Text(\n", + " text=\"Forest Service USA\",\n", + " style=TextStyles.HEADING,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "id": "6182f734-905b-4821-8ca8-33d4435eba6f", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature themed Briefing slides\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: February 05, 2026\n", + "
0 comments, 1 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 29, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_briefing.save()" + ] + }, + { + "cell_type": "markdown", + "id": "7a4c5970-0f88-4bad-bf14-c60a8001befa", + "metadata": {}, + "source": [ + "The slide now displays this map.\n", + "\n", + "![map_slide](https://github.com/user-attachments/assets/dac367bd-0045-4cb5-8ec3-9a0d9b56f578)" + ] + }, + { + "cell_type": "markdown", + "id": "80882be3-aa40-4e43-93ef-86083dab395b", + "metadata": {}, + "source": [ + "### Duplicate this briefing\n", + "\n", + "Similar to a `StoryMap`, you can also `duplicate()` a `Briefing`. \n", + "\n", + "Note: The `duplicate()` function will create a copy of the `Briefing` item alone. To copy the deep dependencies of the Briefing (e.g., maps, scenes, layer, tables), you will need to use the `clone_items()` function. Please refer to the [Cloning and Editing of StoryMaps](../cloning-editing-storymaps) guide to learn more about these differences. " + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "id": "3e343595-89bd-45a3-bf2e-a4a9f96d85f9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Copy of my Nature themed Briefing\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: February 06, 2026\n", + "
0 comments, 0 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 30, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "duplicate = my_briefing.duplicate(\"Copy of my Nature themed Briefing\")\n", + "duplicate" + ] + }, + { + "cell_type": "markdown", + "id": "834de06d-5e7f-45c7-b96c-e969c3419858", + "metadata": {}, + "source": [ + "### Move a slide to the end\n", + "\n", + "You can also [`move()`](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#arcgis.apps.storymap.briefing.Briefing.move) or re-position slides in a Briefing. Let's see a few examples below. \n", + "\n", + "If no value is provided for the `position` parameter, it moves the slide to the end. \n", + "\n", + "Note: Cover slide (index 0) cannot be moved." + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "id": "d45ea02c-0588-4cc4-9831-219b98ceb8e2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 31, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_briefing.move(slide=2)" + ] + }, + { + "cell_type": "markdown", + "id": "87c72896-763d-4b35-ab32-cb9f35211fd0", + "metadata": {}, + "source": [ + "### Move a slide to the top" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "id": "1a2029ea-db78-4fa7-8e6a-6fe274dd9f24", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 32, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_briefing.move(slide=2, position=1)" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "id": "1df39d2a-eda2-4966-843d-501ce9c601a9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature themed Briefing slides\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: February 06, 2026\n", + "
0 comments, 3 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 33, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_briefing.save()" + ] + }, + { + "cell_type": "markdown", + "id": "cda9fee9-ebec-4a45-900e-621b52925ae9", + "metadata": {}, + "source": [ + "### Copy updated content over to the duplicated Briefing" + ] + }, + { + "cell_type": "markdown", + "id": "45a09b27-9b12-4f33-98ff-2948c05e3329", + "metadata": {}, + "source": [ + "The ArcGIS API for Python also allows for copying selective sections of a Briefing over to another using the [`copy_content()`](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#arcgis.apps.storymap.briefing.Briefing.copy_content) method. Use this method if you do not wish to clone all the content of a Briefing. \n", + "\n", + "This capability can be beneficial in a few cases. \n", + "1. You may already have another Briefing item in your organization with relevant slides and information that you need to add to your current Briefing, without cloning the entire Briefing.\n", + "2. You may have cloned an existing Briefing, updated it with a few more slides and would like to copy those over back to the original Briefing.\n", + "\n", + "We will explore the first use-case through an example below. \n", + "\n", + "Note: If you wish to copy all the slides of a Briefing, you need to ensure that you are not copying the `Cover` slide of one Briefing over to another. We can remove that slide by excluding its index, as shown below. " + ] + }, + { + "cell_type": "code", + "execution_count": 34, + "id": "11aa97b5-cfa0-4838-bcdc-c7f1fcff6030", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Sea Otter Habitat StoryMap Briefing\n", + " \n", + "

StoryMap by ssong_geosaurus\n", + "
Last Modified: July 16, 2024\n", + "
0 comments, 2 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "https://storymaps.arcgis.com/briefings/203ca5e1ffc141528cbdf7bced801274" + ] + }, + "execution_count": 34, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "source_briefing_item = gis.content.get('203ca5e1ffc141528cbdf7bced801274')\n", + "source_briefing = Briefing(source_briefing_item)\n", + "source_briefing" + ] + }, + { + "cell_type": "code", + "execution_count": 35, + "id": "95349085-9584-4a94-a993-cacc9183e7c4", + "metadata": {}, + "outputs": [], + "source": [ + "content = source_briefing.slides[1:]" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "id": "387dd074-6979-4688-bd00-3a7acf2da729", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 36, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "source_briefing.copy_content(target_briefing = my_briefing, content = content)" + ] + }, + { + "cell_type": "markdown", + "id": "fdfad894-8b70-4466-a79e-c406101b9b20", + "metadata": {}, + "source": [ + "### Publish the Briefing\n", + "\n", + "We will now publish this Briefing by setting `publish=True` in the `save()` function.\n", + "\n", + "> Note: While we have demonstrated the process to programmatically [`save()`](https://developers.arcgis.com/python/latest/api-reference/arcgis.apps.storymap.html#arcgis.apps.storymap.briefing.Briefing.save) the Briefing throughout this guide, it is strongly encouraged to view and verify the Briefing in the UI and publish it there, especially for the first time you publish a Briefing. " + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "id": "4bc9b954-ee30-4b50-9f96-82257fbff4bc", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "
\n", + " \n", + " \n", + " \n", + "
\n", + "\n", + "
\n", + " Nature themed Briefing slides\n", + " \n", + "

StoryMap by MMajumdar_geosaurus\n", + "
Last Modified: February 06, 2026\n", + "
0 comments, 3 views\n", + "
\n", + "
\n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 37, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "my_briefing.save(publish=True)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "87f085ad-fb83-410b-98c7-021115797247", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "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 +}