© Jennifer Harder 2018
Jennifer HarderGraphics and Multimedia for the Web with Adobe Creative Cloudhttps://doi.org/10.1007/978-1-4842-3823-3_35

35. Working with Bootstrap, Templates, Library Items, and the Assets Panel

Jennifer Harder1 
(1)
Delta, BC, Canada
 

In this chapter, you look at Bootstrap components and jQuery, and learn how they can work with templates and library items to create HTML5 pages in a website that has a theme.

Note

This chapter does not have any actual projects; however, you can use the files in the Part 6 folder to practice opening and viewing for this lesson. They are at https://github.com/Apress/graphics-multimedia-web-adobe-creative-cloud .

Bootstrap

Beyond the ways of working with JavaScript that were mentioned in Chapter 34, Dreamweaver CC allows you to work with code libraries and themes to further modify your galleries and multimedia projects. For example, in the Insert menu, there are tabs such as Bootstrap Components, jQuery UI, and jQuery Mobile (for mobile sites) that contain additional jQuery (JavaScript library) codes that allow you to enhance the layout of your images, such as collapsible dividers, tabs for organization, or galleries. Refer to Figure 35-1.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig1_HTML.jpg
Figure 35-1

The Insert panel has many more widgets included within Dreamweaver that you can use to enhance your site

Check out each of these tabs to discover what they have to offer.

The Behaviors panel has several jQuery effects that can be applied to images if you are not using the CSS animation features. This adds a jQuery assets folder to your site root. Refer to Figure 35-2.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig2_HTML.jpg
Figure 35-2

jQuery Effects that you can add to a div via the Behaviors panel

If you are new to jQuery, you can learn how to use these features and similar features from the following sites, all of which can be used in Dreamweaver and edited further to continue building a responsive website.

Note

The jQuery library does not regularly update in Dreamweaver CC, so if you want the most recent library, you can copy the code or use the external link from the jQuery site. Be aware that by using a newer jQuery version, the Properties panel may not work with the more modern library as expected; also make sure to use only one jQuery library link per page, or use a template-based page because using two versions of a jQuery library may cause a conflict.

Bootstrap is another powerful Dreamweaver tool. This front-end framework is used for ease of web development; it contains many prebuilt components that are composed of HTML, CSS, and jQuery. You can add these components to your own responsive site or to a Bootstrap layout that Dreamweaver generates based on the parameters you set. To use the Bootstrap components successfully from the Insert panel, take the time to understand how they operate.
In addition, you can find some Bootstrap examples for images in the Snippets panel. Refer to Figure 35-3.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig3_HTML.jpg
Figure 35-3

Bootstrap components are in the Snippets panel

The latest version of found in Dreamweaver is 4.0.0, but you can go back one legacy version to 3.3.7 if necessary. Also, if you need the latest updates, go to the official site to download the files. While you can add any of these Bootstrap snippets to your site, a far better way to work with them is to start with a fresh website. Before you start your project, make sure that your site in the Site ➤ Manage site setup is set to Bootstrap 4.0.0; otherwise, your site may not add the latest version of Bootstrap files when you create new pages or components. Refer to Figure 35-4.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig4_HTML.jpg
Figure 35-4

Make sure that your new site is using the latest version of Bootstrap in the Site Setup dialog box

Bootstrap uses HTML elements and CSS that requires that you use HTML5.

Once saved, go to File ➤ New and start with a fresh site, as I did with my Hot Glass Tango site. Refer to Figure 35-5 .
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig5_HTML.jpg
Figure 35-5

Choose the Bootstrap tap to quickly create your first mobile site

To start, I chose the Bootstrap tab and then chose to create new CSS. I then chose to include a prebuilt layout. This is helpful for beginners to Bootstrap so that they have a starting point. I then clicked the Customize button to see what the default grid, gutter system, and screen options are. Refer to Figure 35-6.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig6_HTML.jpg
Figure 35-6

Choose the Bootstrap tab to quickly create your first mobile site

You could alter any of these settings. Bootstrap’s core framework is designed to be responsive and mobile-first. In my project, however, I left them at the default of a 12-column grid system and with a gutter of 30 pixels; the screen sizes are 576, 768, 922, and 1200. You can compare them to my files.

I left the Photoshop comps extract option unchecked; you look at that in Chapter 37.

After you click Create and save your page, you find that additional files, such as jQuery and Bootstrap CSS, have been added to your site root folder. You do not need to do this for the Hot Glass Tango site because you are just reviewing the files. Along with my CSS, you can see other CSS and jQuery that was created in the Files panel. Refer to Figure 35-7.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig7a_HTML.jpg../images/466782_1_En_35_Chapter/466782_1_En_35_Fig7b_HTML.jpg
Figure 35-7

Linked Bootstrap CSS, JavaScript, and jQuery files are added to your own CSS and JavaScript files in the folders in the File panel

Some of the CSS for Bootstrap is added as locked. If you want to alter the CSS in some way, you can do one of two things as I did. You can create a new CSS file with additional media queries and place it below the current Bootstrap CSS in your HTML file, since it is closer to the attributes in the HTML file; it should override some of the CSS from bootstrap-4.0.0.css. Or you can create a copy of the locked boostrap-4.0.0.css file, add your initials to the copy (see Figure 35-7), and then link the copy to your HTML file instead. Here is the code in the <head>:
<link href="../css/bootstrap-4.0.0_jh.css" rel="stylesheet">
<link href="../css/main_mobile.css" rel="stylesheet">

Never try to alter the original locked Bootstrap file. It is best practice to keep the original as a backup in case you make an error or need to revert. I find this the best way to work if you are new to Bootstrap, and you are not sure what some classes are for. I also keep a backup copy of the Bootstrap CSS in another folder outside the site, if for some reason it becomes unlocked accidentally, and I need to add a new file.

I generally do not alter the jquery.js files unless I’ve added a carousel via the Insert panel, as on my gallery.html page, which you look at in more detail in Chapter 39. In it, you might want to slow down the speed of the moving image. Refer to Figure 35-8.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig8_HTML.jpg
Figure 35-8

After you have designed a basic layout you can use the Bootstrap components to add more interactivity for your images

Other items that can be added by Bootstrap include blank dummy images for placement and fonts in the fonts folder. These are all things that you can keep or remove and replace with your own images and fonts as you build your site. You look at web fonts one more time in Chapter 37.

Regardless of how you build your site with or without Bootstrap, one thing that you may find tedious is that once you build one page, you may want to keep the navigation or banner and footer graphics of your site the same for many of your pages. Rather than go to each page and adjust a link every time, you can update all similar areas using templates and library items. You look at this next and how they can be incorporated into your design.

Working with Templates, Library Items, and the Assets Panel

It is important that before you do a lot of work on your site, you are familiar with templates, library items, and the Asset panel and how they relate to inserting HTML, CSS, and JavaScript(jQuery) on to your page.

Templates

A template allows the designer to add further conformity to the website. Dreamweaver has its own set of templates that end in a .dwt file format. The viewer never sees the template, yet it needs to be uploaded to the site with all its linked HTML5 pages so that it can operate correctly.

When most of my students start using templates in Dreamweaver, they are confused as to what its purpose is. Why not just create all of your HTML pages one at a time and make them distinct and different? From a design perspective, a website needs to have a theme or color scheme. If every page is vastly different on a website, the viewer starts to become confused as to where they are. Are they in the same site anymore, or are they somewhere else? Even sites created in programs like WordPress use themes and base a new page off of a common page. This is what a template is.

I find that a template saves time. I can keep common elements locked in the template, and I don’t have to retype or update that area each time I want to create a variation on a new page. You can see from my template in the Files panel Templates folder that after I created a new template (main_v2.dwt), I was able to incorporate the Bootstrap links and code it by copying and pasting into various locations. Refer to Figure 35-9.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig9_HTML.jpg
Figure 35-9

You can add Bootstrap links and HTML5 to your template comments

To start creating a new template page for your project, go to File ➤ New and choose </> HTML template near the bottom of the Document Type column. Refer to Figure 35-10.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig10_HTML.jpg
Figure 35-10

Create a new HTML5 template using the New Document dialog box

Choose HTML template from the New Document List; make sure that it is HTML5 doctype so that it works successfully with Bootstrap, and click Create. This is the same as creating an HTML file except that is has template comment areas; in this example, the comment is green in the <head> tag. Refer to Figure 35-11.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig11_HTML.jpg
Figure 35-11

The new template

Once you save the DWT file, it is added to a new folder called Templates. Refer to Figure 35-12.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig12_HTML.jpg
Figure 35-12

A template is added to the Templates folder

You may receive a warning if you have not added any editable regions to the <body>. Click OK to continue to save the file. You’ll look at this in a moment. Refer to Figure 35-13.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig13_HTML.jpg
Figure 35-13

Until editable regions are added to the <body> you see this warning alert

If you are designing a mobile site, you can also use one of the templates from Starter Templates in the Responsive Starters or Bootstrap Templates folders. You can inspect the samples. Refer to Figure 35-14.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig14_HTML.jpg
Figure 35-14

Work with starter templates if you choose not to start with a blank template

In this case, I started with a blank template for Hot Glass Tango; for your project, a new template opens and is saved in your site root Templates folder with the .dwt file extension.

Adobe Dreamweaver CC Classroom in a Book, by Jim Maivald, provides more information about working with templates. Like Bootstrap, templates are simple to use, but as a beginner, you can make some very subtle mistakes and files can become easily corrupted. The following are few important notes about HTML5 templates:
  • Do not move the template (.dwt) file out of the Templates folder. This causes the links within to break and may cause it to stop working.

  • Do not rename the Templates folder, leave the folder name with a capital letter.

  • Within template file in code view do not change the text within the <title>Untitled Document</title> tags, you only change the text here when inside of the template-based pages.

  • Do not remove or alter the template comments that are in the template file.

<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->

Doing any of these things corrupt the template and cause it not to work correctly.

The template behaves like any other HTML5 page. The main difference is that it has areas that are set and do not change. To have areas that change on your template-based pages, you need to create editable areas or regions. When a template is first created, it has a few editable areas in the <head>.
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
They are set within comment tags. Dreamweaver recognizes these editable areas by the attribute name; in this case “doctitle” or “head”. While working in the template <head>, you do not add or alter anything inside of this editable area. This area is only edited inside the template-based page. If you want to add JavaScript or CSS to your <head> in the template, you need to add it outside of the editable area.
<!-- TemplateBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- TemplateEndEditable -->
<script>Add a script here</script>
<link href="../main.css" rel="stylesheet" type="text/css">
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<script></script>
</head>

Adding Editable Areas

In Figure 35-13, when you first started adding designs to your template <body> area, it contains no editable regions. After working on the layout, if you save the template, you get an alert stating that there are no editable regions. The purpose of editable regions is to control which area of the template’s base design you can edit on your template-based pages.

Until you are ready to add an editable region, you need to press OK in the alert; otherwise, you can check the Don’t Warn Me Again button, if you find this too repetitive.

To add an editable area, make sure that you are in the <body> in the <div> or element that you want to make editable. From the Insert panel ➤ Templates tab, choose Editable Region. Refer to Figure 35-15.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig15_HTML.jpg
Figure 35-15

In the Insert panel in the Templates tab choose Editable Region

You are asked to give that editable region a meaningful name; when you are done, click OK. Refer to Figure 35-16.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig16_HTML.jpg
Figure 35-16

Adding a new editable region to your page

This adds a template comment to that area in the <tag> element.
<body>
<div>
<header></header>
<main>
<!-- TemplateBeginEditable name="Story" -->Add Editable Content here<!-- TemplateEndEditable -->
<main>
</div>
</body>
Figure 35-17 shows how it appears in Design view.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig17_HTML.jpg
Figure 35-17

A template editable region is added and this is how it appears in Design view

Once you start creating template-based pages, this is the area that is available to you to add new graphics and video; all the other areas outside of this editable area remain locked unless you go back into the template and edit.

You can add as many editable areas as you want to your template. Hot Glass Tango template has two.
<!-- InstanceBeginEditable name="Subtitle" -->
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="main-story" -->
<!-- InstanceEndEditable -->

Note

You can also have a “hidden” editable region if additional JavaScript or jQuery needs to be added to an area at the bottom of the page before the </body> closes. The reason for doing this, is because some JavaScripts require this order. Not all template-based pages require the same JavaScript. Doing this is an alternative to putting the JavaScript into the template so that it loads everytime each template-based page opens.

Additional Editable Region Options

Here are some other template features you may want to explore further on your own. They are found in Insert panel ➤ Template tab.

Make Template

This makes a template out of a current file or another template. Just be aware that sometimes corruption can occur, so it is always best to start with a new blank template (see https://helpx.adobe.com/dreamweaver/using/dreamweaver-templates.html ).

Make Nested Template

A nested template’s design and editable regions are based on another template. Nested templates are useful for controlling content in pages on a site that share many design elements but have a few variations. For example, a base template might contain broader design areas and be usable by many content contributors for a site, while a nested template might further define the editable regions in pages for a specific section in a site.

Editable Region

These areas in a base template are passed through to the template or nested template and remain editable in pages created from a template unless new template regions are inserted in these regions. Changes to a base template are automatically updated in template-based pages, and in all template-based documents that are based on the main and nested templates. For more details on this topic visit these links:

https://helpx.adobe.com/dreamweaver/using/creating-nested-template.html

https://helpx.adobe.com/dreamweaver/using/creating-editable-regions-templates.html

https://helpx.adobe.com/dreamweaver/using/editing-content-template-based-document.html

Be aware that adding or altering editable regions while inside the template after the template-based pages have been created, these changes may not appear in the template-based pages.

Optional Region

An optional region is where users can set to show or hide in a template-based document. Use an optional region when you want to set conditions for displaying content in a document. When you insert an optional region, you can either set specific values for a template parameter or define conditional statements (If...else statements) for template regions. Use simple true/false operations or define more complex conditional statements and expressions. You can modify the optional region if necessary. Based on the conditions you define, template users can edit the parameters in template-based documents they create and control whether the optional region is displayed. You can link multiple optional regions to a named parameter. In the template-based page, both regions show or hide as a unit. For example, you can show a “closeout” image and sales price text area for a sale item. For more information, visit https://helpx.adobe.com/dreamweaver/using/using-optional-regions-templates.html .

Repeating Region

A repeating region is a section of a template that can be duplicated many times in a template-based page. Typically, repeating regions are used with tables, but you can define a repeating region for other page elements. Repeating regions enable you to control your page layout by repeating certain items, such as a catalog item and description layout, or for data such as a list of items. There are two repeating region template objects that you can use: repeating region and repeating table. For more information, visit https://helpx.adobe.com/dreamweaver/using/creating-repeating-regions-templates.html .

Editable Optional Region

An optional region is non-editable but editable optional region is.

For more information, visit https://helpx.adobe.com/dreamweaver/using/using-optional-regions-templates.html .

Repeating Table
See Repeating Region for more information. Refer to Figure 35-18. The Insert Repeating Table dialog box appears when this selection is made. It is similar to the insert table dialog box. Here you can set various setting such as rows, columns, cell padding, cell spacing, width, border, the rows of the table that will repeat and the region name.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig18_HTML.jpg
Figure 35-18

The Insert Repeating Table dialog box

Creating a Template-based Page

Once you have created and saved your template in the Templates folder with its editable regions, it is time to create a template-based page.

Go to File ➤ New ➤ Site Template. Refer to Figure 35-19.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig19_HTML.jpg
Figure 35-19

Creating a template-based page from the New Document dialog box

Here you locate your site and then select the template that you want to base the page on. Generally, you only have one template per site, but there may be cases in which you need more than one, depending upon your layout. I created index.html but did not make it template-based. This is important to consider during the layout and planning stages of building your site, especially if you need to keep your links updated. You then see a preview of the layout. Before you click Create, make sure that Update Page is checked when the template changes.

Hidden Area in <head> Tag of a Template-based Page

When you create the template, you add <script> tags for JavaScript and external CSS outside of the editable areas if you want to affect all template-based pages. If you want to affect only one template-based page, then you add the JavaScript or CSS inside of the editable area called head in the <head> tag of that template-based page.
<!-- TemplateBeginEditable name="head" -->
Add Scripts or CSS internal or external here
<!-- TemplateEndEditable -->

When adding CSS or JavaScript in this area, if it is above or below other CSS or JavaScript in the template, or if there is class or ID naming conflicts, it may affect the way the code behaves. So, keep this in mind as you add your code to this area.

Templates Are Updateable

The wonderful thing about templates (.dwt) is that if you make an update to a graphic or text in a non-editable area, and then save the template, Dreamweaver makes that change globally to all pages that are based on that template. You can ensure that this is happening when the Update Template Files dialog box appears. Refer to Figure 35-20.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig20_HTML.jpg
Figure 35-20

Update the template-based pages when the template is altered and then saved

In this example, you can see how many pages are affected.

If this is not the same number of pages that you know are template-based to that specific template, then there might be an issue of corruption with that HTML5 page or it may have become detached.

Click Update to update all the files.

This brings up another dialog box called Update Pages. Dreamweaver looks in the files (template-based pages) that use this template and updates them. Alternatively, you can choose to update the entire site. When complete, the Done icon is available and the log shows Done at the bottom of the report. If there any errors during the update, they are logged as well. Refer to Figure 35-21.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig21_HTML.jpg
Figure 35-21

Update Page dialog box logs all files that were examined and updated

If you change the setting here, the Done button changes to a Start button, and you can run the update again.

When done, click the Close button, and you can close your template file. When you open a template-based file, you see that the change to template has happened to it and all your template-based pages.

Troubleshooting Templates

Note

While you are working in the template, it is best to close all your template-based HTML pages because when you save the template changes, Dreamweaver makes the changes to the open template-based page, but it won’t save it right-away. You then have to save the file upon closing, which is just an extra step in the work flow.

Sometimes when working with templates (at least on Microsoft computers), Dreamweaver appears to slow down. If you notice that not all of your template-based pages are showing up, it could mean one of two things. You were working with too many open files in Dreamweaver. With large sites, it is best to work with your project on an external drive. Close Dreamweaver, then open the program again and retry the update; this should correct the issue. If it does not, check if your template or the template-based page has become corrupted. In that case, you may need to re-create your template and try again.

Alternatively, new templates can be attached to template-based files in Tools ➤ Templates ➤ Apply Template to Page. If the editable regions and layout are relatively the same, you can switch your template to a new one. Test a copy of one page to make sure that the transition is possible for other template-based pages. Refer to Figure 35-22.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig22_HTML.jpg
Figure 35-22

Additional template options in the Tools drop-down menu

Other options allow you to detach a template, check that its syntax is correct, makes an attribute editable that allows you to make advanced edits to a specific page, and reviews any editable regions. Refer to Figure 35-23.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig23_HTML.jpg
Figure 35-23

review the editable regions in your template

Library Items

Library items are actual files that can contain individual links to assets that you can place in your template-based webpages. The smaller pieces of code that they contain should be added to the editable areas of your template-based pages. You saw an example of library type items in Animate CC, where movie-clip symbols were stored. Library items (.lbi) are repeating pieces that you may want to use more than once on your site, but not on all pages. If you want to use pieces of code on every page, then add that code to the template, not as a library item to every page. If you want to code only on a few pages, or more than once on a page, like a button or link, then used a library item. Refer to Figure 35-24, which shows the Files panel.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig24_HTML.jpg
Figure 35-24

Library items folder with a library item inside

The following are a few important notes about library items:
  • Dreamweaver stores library items in a single library folder in the root directory of each site.

  • Like templates, do not move the library items (.lbi) file out of the library folder. This causes the links within to break and may cause it to stop working.

  • Do not rename the library folder and leave the folder name with a capital letter.

  • Like templates, library items can be updated after saving, and the changes cascade throughout the site. Refer to Figure 35-25 .

../images/466782_1_En_35_Chapter/466782_1_En_35_Fig25_HTML.jpg
Figure 35-25

Update the library items on their pages once a change is made

The Tools menu allows you to update or add an object to the library folder. Refer to Figure 35-26.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig26_HTML.jpg
Figure 35-26

The Tools drop-down panel allows you to update the library items

However, creating and inserting a library items is a bit different than creating a template page. To do that, you need to the Assets panel.

Creating and Adding Library Items with the Assets Panel

The Assets panel is the main way to create and insert library items onto a template-based page. See the open book icon at the bottom of the list on the left. Refer to Figure 35-27.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig27_HTML.jpg
Figure 35-27

The Assets panel allows you to review items such as how many library items you have and then preview them

Additionally, the icons on the left side let you preview all images, colors, links, media, JavaScript, and templates. It is just another way to see all of your media and colors in your root folder without having to open an HTML File or search through the Files panel. Refer to Figure 35-28.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig28_HTML.jpg
Figure 35-28

Previewing Images using the Assets panel

To create a library item, whether it is text, a graphic, or a combination of both, open the Assets panel. Click the Library tab and click the New Library Item button. Refer to Figure 35-29.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig29_HTML.jpg
Figure 35-29

Add a new library item

This adds a new library item to the list and to your library folder, as seen in Figure 35-29. Dreamweaver gives you steps as to what to do next. First, you name the library item and then you click the Edit button and start adding your content. Refer to Figure 35-30.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig30_HTML.jpg
Figure 35-30

Adding a library item

Or you can double-click the library item’s name to open it. Refer to Figure 35-31.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig31_HTML.jpg
Figure 35-31

Rename and open the library item by double-clicking on it

The library item can be viewed in Code view, Split view, Design view, or Live view. Refer to Figure 35-32.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig32_HTML.jpg
Figure 35-32

View a library item as you would an HTML page or template

However, be aware that you are only adding a line of code. A library item is only a part of a webpage, not the whole webpage. So, you only add an image or a few lines of code. You only reference the class in the tag, but you do not add the actual CSS external link to the library item.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<p class="bold-text">
   <a class="one"  href="mailto:[email protected]">Contact Jennifer</a>
</p>

If you’re just looking at the library item, and it still is not linked or inserted to an actual page, then the formatting of the text appears different than what you expect. Even in Design view it appears unformatted, but this is OK. Once it is on a page with a CSS internal or external link, it references the class or ID and appears correctly styled.

The following is an example of the CSS in an external style sheet.
.bold-text{
font-weight:bold;
}
.one{
color:green;
}

When you are finished creating the library item, save it and close it.

Now open the template-based page, and in Code or Design view, find the location in a <div> or sematic element that you want to insert your library item. With it selected, click the Insert button. Refer to Figure 35-33.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig33_HTML.jpg
Figure 35-33

Insert a library item onto a template-based page

This inserts your library item and its line of code and library comment tags has a yellow border.
<!-- #BeginLibraryItem "/Library/emaillink.lbi" -->
          <p class="bold-text"><a class="one"  href=" mailto:[email protected] ">Contact Jennifer</a></p>
          <!-- #EndLibraryItem -->

This area of code is locked on the HTML page, and you cannot edit it. To edit, you must go back to the Assets panel or the Files panel and double-click to open. Make changes and save it so that it updates in all locations, and then close the library item.

Detach Library Item

You may want to detach a library item to edit or create a new example.

If you want to detach the library item, you need to select it on a page, and in the Properties panel, you have the following options.
  • Open: This opens the library item.

  • Detach from original: To alter the selected library item on a page, this button allows you to detach and break the link to the original item, so that the code on the page is not part of the library link anymore. Refer to Figure 35-34. If you detach, the link is no longer linked to library item and therefore does not automatically update with the other library items.
    ../images/466782_1_En_35_Chapter/466782_1_En_35_Fig34_HTML.jpg
    Figure 35-34

    Detach a library item

  • Recreate : Allows you to override the library item. Refer to Figure 35-35.

../images/466782_1_En_35_Chapter/466782_1_En_35_Fig35_HTML.jpg
Figure 35-35

You are asked if you want to overwrite the library item

Likewise, you can highlight text or an image in your <body> and in the Assets panel, click New Library Item. This speed up the process. If you don’t like the results, click the Trash icon to remove it entirely from your root folder. Just keep in mind that this is a permanent change and affect any area on pages you added the library items to and the link becomes missing. Refer to Figure 35-36.
../images/466782_1_En_35_Chapter/466782_1_En_35_Fig36_HTML.jpg
Figure 35-36

When you delete a library item, it is permanently removed

Note

Regarding the Asset panel, if you are in Live or Design view, some tabs may be missing, so to ensure that you see all the tabs while working, use Design view. Refer to Figure 35-37.

../images/466782_1_En_35_Chapter/466782_1_En_35_Fig37_HTML.jpg
Figure 35-37

The Asset panel changes from Live to Design view

Summary

In this chapter, you looked at how Bootstrap is added to a template and how templates are useful so that your website has a theme and looks consistent. You also looked at library items and how they can be added to a website for select pages, but not to every page. Finally, you looked at the Assets panel and how you can use it to view images, templates, and library items that are inside your site’s root directory folder.

In the next chapter, you look at how to add audio, video, and animations to your site.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.154.171