Skip to content
Charles Moad edited this page Aug 31, 2012 · 2 revisions

Creating a custom stop type

A powerful feature of the TAP authoring tools is how easy it is to create your own Stop content types. This page walks through the steps of creating an Image Gallery Stop content type, and then creating instances of that stop type.

In Drupal, navigate to "Admin -> Structure -> Content types -> Add content type". You should see a form similar to that seen below.


Name your content type, "Image Gallery Stop" and give it a description.


In order to make certain fields translatable, be sure to click the "Publishing options" tab and select "Enabled, with entity translation" under the "Multilingual support" section. This setting allows us to select which fields of data we would like to translate to other languages.


Now click "Save and add fields" in order to save your new content type. You should now see a screen like the one below. For our example we are going to "delete" the "Body" field since we are not going to need it for our Image Gallery Stop (hypothetically in our example of course).


Now we are going to add two existing fields. They were installed along with the tap_features module.

  1. Under "Add existing field" select "field_tour_reference (Tour Reference)". Type "Tour Reference" in the "Label" field and select the default widget type. This field is used across all stop in order to specify which tour they are a part of. Stops may only be associated with a single tour. Click "Save".
  2. Now add one more existing field, "field_code (Code)". Type "Code" in the "Label" field and select the default widget type again. This field represents a keypad code that a visitor would type in order to visit an Image Gallery Stop. Click "Save".

Feel free to reorder the fields and save again. Your screen should now look this the one below.


Now we are going to add our new fields of data to the content type. First, we'll add a field for our set of images which will comprise the gallery. Under "Add new field" enter "Images" for the "Label", "images" next to "field_", and select "Multimedia asset" as the field type with "Media file selector" as the widget. See the screen below for reference. Using the media module for handling your assets is suggested, because it allows for the easy reuse of assets across stops in the same way TourML does. Once done, click "Save".


You should now see the "Field settings" for the images field. Just click "Save field settings".


You will now have an opportunity to edit the "Images" field. You may enter "Help text" like in the example seen below.


Scrolling down you will see more options for the "Images" field. Be sure that "Image" is selected as the only "Allowed remote media types" and that at least "public:// (Public files)" is selected under "Allowed URI schemes". Finally, be sure to select "Unlimited" under "Number of values" so we can upload more than one image to this field. Once done, click "Save settings".


We will now add one more new field, "Subtitle", that is of type "Long text". See the image below for reference. Once you have entered that information, click "Save".


For this example, we are going to say that we do want to translate the text that appears in the "Subtitle" field. Be sure to check the box "Users may translate this field" like seen in the screen below. Click "Save field settings".


You will now see the edit options for the "Subtitle" field. Feel free to add "Help text" then scroll down and click "Save settings".


We are finished creating the new content type, "Image Gallery Stop". Your fields should look the same as the screen below.


Creating stop content

Now we will demonstrate how to create Stop content using our "Image Gallery Stop" content type that we created before. This process should be generally the same across all Stop types and across all Drupal content for that matter.

Navigate to "Add content" in Drupal and click the link for "Image Gallery Stop". Enter some example information like that seen below. Be sure to select a language (e.g. "English") for this stop so we can translate it later. Also, select the tour that this stop will be a part of in the "Tour Reference" field. If you have not created a tour node yet, then there will be no options.


Now you can add your images using the media selector. Click "Select media" in the "Images" field. From this screen you can upload and/or reference images in a multitude of ways. The screen below demonstrates selecting images that are already in our library.


Now this screen shows the options for uploading an image. Depending on what you have enabled with the media module, you might have additional options.


Once you are done adding your images to the stop, click "Save". You should now see your new stop like the one seen in the screen below.


If you specified which tour this stop was a part of you may visit that tour and see your new stop listed.


This page simply describes the process for creating a new Stop content type. You may have noticed that everything we showed was provided by Drupal and a few additional modules, not TAP. This is intentional. You should now proceed to mapping content to TourML to see how to configure your content type so it can be exported as TourML.

Clone this wiki locally