Shortcoder Modifications

What is a shortcoder shortcode? It looks like this:
[sc name="Photo-Info-Colonel"]
It is a way to reuse the same information in multiple locations so that changes can be made once in one location and it is changed everywhere.

The shortcodes are saved for each site. The main ISP site is the reference standard for all our sites (except POST).

Any change should be made in the main ISP site’s shortcodes regardless of whether or not it shows up there. We then must export and import to other sites that need the changes.

Making sure you are in the ISP site

Make sure you are on the ISP main website. The current site will appear at the top of the screen when logged in as an administrator.

Above is what it will look like when you are logged into the ISP site. If you are logged in to another site you may change to the ISP site by hovering over “My Sites” and then going down and to the right on “Network Admin” and then clicking on “Sites”

The site should automatically change to ISP so you will see “Official website of…” at the top of the screen but if for some reason it doesn’t change hover on the top site (isp.idaho.gov — Main) and then click on “Dashboard” below it.

This will insure that you are in the ISP site so that all your changes will be made in the correct site and won’t “mysteriously” disappear in the future.

 

Uploading a new picture

If you will be updating or adding a new picture into this shortcode you will want to first edit the picture per:
Formatting People Pictures
Once you have the picture perfectly cropped to the correct aspect ratio you should upload it to the Media library

Just drag the file onto the “other pictures” of the Media library and it will be uploaded and placed in the top left of the pictures. Now that it has been uploaded we need a critical little piece of information from it.

Click on the newly uploaded picture and it will show it larger with a bunch of information displayed on the right side. We need a portion of the “Copy Link”

We need from the right side of the “v” starting with the “/” all the way to the right. Copy this as you will need it for the path to the picture in the shortcoder.

 

Finding the Shortcoder to edit

On the left side toolbar select “Shortcoder”.

Don’t get confused by the “Shortcodes” further down the list.

A list of all our current shortcodes will appear.

Using the search function (circled above) you can filter the list to allow you to quickly find the shortcode you need.

There is a consistent naming scheme that has been used for these shortcodes to help you search and filter them. For example all of the pictures that have name, rank, and phone number below them start with “Photo-Info” and then the name of the position. For example the Colonel’s shortcoder is named: “Photo-Info-Colonel”. We have made shortcodes for all the current positions that are listed on the website. As people are promoted or retire they need to be updated with new people. There are also some other standard named shortcodes for phone numbers, fax numbers,  and addresses. So you can search by both the type and by the position name to find your shortcode. For example if you needed to edit a phone number for one of the captains you could either search for “Phone” or “Captain” and get a short list in which to find your desired shortcode.

Editing a shortcode

Once you have found the shortcode that you want to edit. Click on the name of the shortcode and it will be opened in the editor.

For this example we will use the Colonel’s photo and info shortcode mentioned above. To update this you should only have to change text in the three spots highlighted in the above image (click on the image to make it bigger). 

Update The Picture
To update the picture, you will be using the text you copied from the instructions above when you uploaded the picture to the Media library.


Highlight the text in the shortcode as shown above (everything between the quotes) and paste the text you got from the picture you uploaded above replacing the existing text.

Update the Email Address
To update the email address replace the text between the “:” and the “@” with the new email address. 

We shouldn’t have to replace the “@isp.idaho.gov” because we all have that.

Update the Person’s Name
To update the name of the person replace the text after the title (if any)

and before the closing a-tag (</a>)

That should cover it for this example. The only other example that is perhaps a little confusing is updating a phone number. We will use District 1’s CVS phone number (at the time of this articles creation):

<a href="tel:1-208-209-8620">208.209.8620</a>

You will notice that the phone number is in there twice. Yes that is on purpose and yes you have to change both. This format is used so that if this phone number is viewed on a phone you can dial the number by pressing it. If you have serious attention to detail you might have noticed that the first number uses dashes “-” and the next one uses dots “.” to separate the numbers. FYI: the first number is what gets dialed and the second one is what gets seen in the webpage. We use dots to separate our phone numbers because it looks cool. That’s all, but we did it everywhere.

Exporting Changes

Now that you’ve made a change to the Shortcoder shortcodes you now need to get it into any site that uses it. To do this you need to export the shortcodes and then switch to the site that needs it and import the shortcodes there. Once the shortcodes are exported from the ISP site they may be imported to as many or all the sites (except POST) as needed. If in doubt, err on the side of importing. It doesn’t hurt to import it to a non-POST site that doesn’t need it. This process is outlined below:

First (and most important step!) make sure you are in the ISP site so it says “Official Website of the Idaho State Poli…” at the top left of the WordPress toolbar like this:

On the menu bar down the left side click on “All Export”.

This will start the export process. Click Shortcoder.
(click on images to enlarge)

The screen should look like this then click on “Migrate Shortcoder”

Take note of the “Friendly Filename” as you’ll need to know which file to import later. It defaults to “Shortcoder Export – <today’s year / month / day / time>”. Unless you would like to change it to something else press  “Confirm and Run Export” below.

A bunch of things will happen and the file will compile. Once this is done press the “Bundle” button.

Make sure “Save File” is checked and press “OK”. The necessary files will all be compressed into a nice little zip file with the “Friendly Filename” from above so that you may use it later for the import process outlined below.



Importing Changes to Other Sites

First let me warn you, do NOT import into the POST site! POST has a completely separate set of shortcodes and accidentally importing ISP shortcodes into the POST site will do significant damage (and vise-versa). All other ISP sites should be the same so importing the shortcodes from the main ISP site is OK to do even if changes and additions aren’t used in the site importing it. So if you made a change to a phone number in the main ISP site’s shortcodes and are ‘pretty sure’ that change is also used in the Patrol site’s pages it is OK to go ahead and import your file into Patrol even if you are unsure if Patrol uses it.

Takeaway: You are safe as long as you don’t import to POST.

The first step to importing shortcodes to a site is to go to that site.

Hover over “My Sites”, then go down and to the right on “Network Admin”, and then click on “Sites”

Hover over the site you need to go to and click on “Dashboard” below it. This will take you to that site.

VERY IMPORTANT
Make sure you are NOT in the ISP site when you import!

If it says “Official website of the Idaho State Police” YOU ARE DOING IT WRONG! Go up above and start this section over again.

**Update**
Due to recent changes in the way “All Import” imports shortcodes the following steps are now necessary:
On the left side toolbar select “Shortcoder”.

Don’t get confused by the “Shortcodes” further down the list.

A list of all our current ‘Shortcoder’ shortcodes will appear.

We are now going to delete all of the shortcodes. To do this click on the “Bulk Actions” drop-down and select “Move to Trash”
Next select the top box next to “Title” (to select all the shortcodes) and press “Apply”.

This will delete all of the shortcodes and after a moment you will see a screen similar to this:

Note that all of the shortcodes (they call them posts here) were moved to the trash and there are none shown below.
***end update***

On the menu bar down the left side click on “All Import”.

Import the data by pressing “Upload a file”.
(click image to enlarge)

When you exported the shortcode data (above) by default the export file will go to the “Downloads” folder (unless you told it to go somewhere else). Find and select your file.

The file will upload.

**Update**
Per the update above this step changes slightly. Since we have deleted all the shortcodes we no longer need to press the ‘Existing’ items button. So now all we have to do is click “Skip to Step 4”.

***end update***

Some configuration for how to import will appear. Ignore this and press “Continue”.

A summary of what the importer will do is displayed. Click “Confirm and Run Import”.

Finally the import will run and the results will display.

Note: it is normal to have a bunch of warnings. There shouldn’t be any actual errors. Check your changes on the website to make sure they are there and if not clear the cache to make sure you are seeing the most current file (<Ctrl>F5). If you are still not seeing your change then something went wrong.

Note: the POST site is separate and PLEASE do NOT import to the POST site!

ver: 1.0.0 | last updated: