Quantcast

The Multiple If condition in template code in Macromedia Dreamweaver

Posted by mrshuzan on May 20th, 2012

The Multiple If condition in template code in Macromedia Dreamweaver

 

You are able to describe template appearances for if & several-if conditions (observe Template expressions in dreamweaver). This example shows important a parameter named “Dept”, setting a primary value & important a several If condition which determines which logo to show.

 

The following is an example of the code you may enter in the head section of the template:

 

<!-- TemplateParam name="Dept" type="number" value="1" -->

The following situation statement checks the value allocated to the Dept parameter. While the condition is matches or true, the suitable image is showed.

<!-- TemplateBeginMultipleIf -->
<!-- checks value of Dept and shows appropriate image-->


<!-- TemplateBeginClause cond="Dept == 1" --> <img src=".../sales.gif"> <!-- TemplateEndIfClause -->
<!-- TemplateBeginIfClause cond="Dept == 2" --> <img src=".../support.gif"> <!-- TemplateEndIfClause-->
<!-- TemplateBeginIfClause cond="Dept == 3" --> <img src=".../hr.gif"> <!-- TemplateEndIfClause -->
<!-- TemplateBeginIfClause cond="Dept != 3" --> <img src=".../spacer.gif"> <!-- TemplateEndIfClause -->

<!-- TemplateEndMultipleIf -->

While you make a template-based document, the template parameters are mechanically passed to it. The template user decides which image to show (observe Modifying template properties in dreamweaver).

 

The template expression language in Macromedia Dreamweaver

Posted by mrshuzan on May 20th, 2012

The template expression language in Macromedia Dreamweaver

 

The template appearance language is a little subset of JavaScript & uses JavaScript syntax & priority rules. You be able to utilize JavaScript operators to write an appearance like this:

@@(firstName+lastName)@@

The following features & operators are supported:

  • string literals, numeric literals (double-quote syntax only), Boolean literals (true or false)
  • variable reference (observe the list of described variables later in this section)
  • field reference (the “dot” operator)
  • unary operators: +, -, ~, !
  • binary operators: +, -, *, /, %, &, |, ^, &&, ||, <, <=, >, >=, ==, !=, <<, >>
  • conditional operator: ?:
  • parentheses: ()

The following data kinds are used: Boolean, IEEE 64-bit floating point, string, & object. Macromedia Dreamweaver templates don’t maintain to utilize of JavaScript “undefined” or “null” kinds. Nor do they permit scalar kinds to be absolutely converted into an object; thus, the appearance “abc”. length would activate an error, in its place of yielding the value 3.

The just objects obtainable are those described by the appearance object model. The following variables are defined:

_document

Contains the document-level template data with a field for every parameter in the template.

_repeat

Just described for appearance which come into view inside a repeating region. Gives built-in information about the region:

_index The numerical index (from 0) of the current entry

_numRows The total number of entries in this repeating region

_isFirst True if the current entry is the first entry in its repeating region

_isLast True if the current entry is the last entry in its repeating region

_prevRecord The _repeat object for the previous entry. It is an error to access this property for the first entry in the region.

_nextRecord The _repeat object for the next entry. It is an error to access this property for the last entry in the region.

_parent In a nested repeated region, this gives the _repeat object for the enclosing (outer) repeated region. It is an error to access this property outside of a nested repeated region.

All through appearance evaluation, all fields of the _document object & _repeat object are absolutely obtainable. Such as, you be able to enter title instead of _document.title to right of entry the document’s title parameter.

In cases anywhere there is a field conflict; fields of the _repeat object take priority over fields of the _document object. As a result, you should not require to openly reference _document or _repeat except that _document may be required inside a repeat region to reference document parameters that are hidden by repeated region parameters.

While nested repeated regions are used, just fields of the inmost repeated regions are obtainable absolutely. Outer regions should be openly referenced using _parent.

 

Template expressions in Macromedia Dreamweaver

Posted by mrshuzan on May 20th, 2012

Template expressions in Macromedia Dreamweaver

 

Template looks are statements you utilize to compute or assess a value.

You are able to utilize a look to store a value & show it in a document. Such as, an look be able to as simple as the value of a parameter, for example @@(Param)@@, or difficult much to compute values which every other the background color in a table row, for example @@((_index & 1) ? red : blue)@@.

You be able to also describe looks for if & multiple-if conditions (such as, observe The Several If condition in template code). While a look is used in a conditional statement, Macromedia Dreamweaver assesses it as false or true. If the situation is true, the optional area comes into view in the template-based document; if it is false, it does not come into view.

You be able to describe looks in Code view or in the Optional Region dialog box while you insert an optional region. For more details about writing template looks, observe The template expression language in dreamweaver.

In Code view, there’re 2 methods to describe template expressions: utilize the <!-- TemplateExpr expr="your expresson"--> comment or @@(your expression)@@. While you insert the look in the template code, a look marker appears in Design view. While you apply the template, Macromedia Dreamweaver evaluates the look & shows the value in the template-based document.

This section covers the following posts :

  • The template expression language in dreamweaver
  • The Multiple If condition in template code in dreamweaver

 

Template parameters in Macromedia Dreamweaver

Posted by mrshuzan on May 20th, 2012

Template parameters in Macromedia Dreamweaver

 

Template parameters specify values for controlling content in documents based on a template. You are able to utilize template parameters with elective regions or editable tag attributes or to set values you desire to pass to an attached document. For every parameter, you choose a name, a default value & a data type. Every parameter should have an exclusive name; every name is case sensitive.

 

Template parameters are passed to the document as example parameters. In the majority cases, a template user is able to edit the parameter’s default value to modify what comes into view in a template-based document. In extra cases, the template writer may decide what comes into view in the document, based on the value of a template look (observe Template expressions in dreamweaver).

Related posts of macromedia dreamweaver

  • Using optional regions in dreamweaver
  • Defining editable tag attributes in dreamweaver

 

 

Server scripts in templates & template-based documents in Macromedia Dreamweaver

Posted by mrshuzan on May 20th, 2012

Server scripts in templates & template-based documents in Macromedia Dreamweaver

 

A few server scripts are inserted at the especially end or beginning of the document (after the </html> tag or previous to the <html> tag). Such scripts need particular treatment in templates & template-based documents. Usually, if you make modifies to script code after the </html> tag or previous to the <html> tag in a template, this modifies aren’t copied to documents based on that template. This is able to cause server errors if extra server scripts, in the main body of the template, depended on the scripts that aren’t copied. Accordingly, Macromedia Dreamweaver cautions you if you modify scripts after the </html> tag or previous to the <html> tag in a template.

 

To keep away from this problem, you are able to insert the following code in the head section of the template:

<!– TemplateInfo codeOutsideHTMLIsLocked=”true” –>

 

While this code is in a template, modifies to scripts after the </html> tag or previous to the <html> tag are copied to documents based on that template. Though, you will no longer be able to edit those scripts in documents based on the template. Therefore, you be able to prefer to be able to edit these scripts in the template, or in documents based on the template, but not together.

 

Nested templates in Macromedia Dreamweaver

Posted by mrshuzan on May 17th, 2012

Nested templates in Macromedia Dreamweaver

 

A nested template is a template whose design & editable regions are based on one more template. To make a nested template, you should first save the original or base template, and then make a new document based on the template, and after that save that document as a template. In the new template, you be able to additional describe editable regions in areas initially described as editable from the base template.

 

Nested templates are helpful for managing content in pages of a site that share a lot of design elements, but have some variations among pages. Such as, a base template may contain broader design areas & be practical by a lot of content donors for a site, when a nested template may additional describe the editable regions in pages for a particular section in a site.

 

Editable regions in a base template are passed from side to side to the nested template, & stay editable in pages shaped from a nested template except new template regions are inserted in these regions.

 

Modifies to a base template are mechanically updated in templates based on the base template, & in all template based documents that are based on the major & nested templates.

 

In the following example, the template haves 3 editable regions, Nav Bar, Footer & named Body:

 

To make a nested template, we shaped a new document based on the template, after that saved the document as a template & named it TrioNested. In the nested template, we added two editable regions, with content, in the editable region named Body.

 

While you add a new editable region in an editable region passed during to the nested template, the importance color of the editable region modifies to orange. Content you add in an editable region, for example the graphic in the editable Column, is no longer editable in documents based on the nested template. The blue highlighted editable areas, whether added in the nested template or passed during from the base template, stay editable in documents based on the nested template. Template regions you don’t insert an editable region in, pass during to template based documents as editable regions.

Related posts of Macromedia Dreamweaver

  • Creating a nested template in dreamweaver

 

Links in templates in Macromedia Dreamweaver

Posted by mrshuzan on May 17th, 2012

Links in templates in Macromedia Dreamweaver

 

To make a link in a template file, utilize the folder icon or the Point to File icon in the Property checker; do not type in the name of the file to link to. If you type the name, the link may not work. This section explains how Macromedia Dreamweaver handles links in templates.

 

While you make a template file from an existing page, after that save that page as a template, Macromedia Dreamweaver updates the links so they point to the equal files as previous to. Because templates are saved in the Templates folder, the path for a document comparative link modifies while you save the page as a template. In Macromedia Dreamweaver, while you make a new document based on that template & save the new document, all the document comparative links are updated to carry on to point to the correct files.

 

While you add a new document comparative link to a template file, though, if you type the path into the link text box in the Property checker, it is simple to enter the incorrect path name. The right path is the path from the Templates folder to the linked document, not the path from the template based document’s folder to the linked document.

For more details about linking using the Point to File icon, observe Linking files & documents in dreamweaver.

NOTE   In a few cases, (for example file paths in occasion handlers in templates) you can not utilize the folder icon or the Point to File icon; in those cases, you should enter the right path name.

 

 

 

Template tag syntax & General syntax rules in Macromedia Dreamweaver

Posted by mrshuzan on May 17th, 2012

Template tag syntax & General syntax rules in Macromedia Dreamweaver

Template tag syntax in Macromedia Dreamweaver

This section explains the general syntax rules & lists the HTML comment tags Macromedia Dreamweaver utilizes to identify regions in templates & template based documents. Macromedia Dreamweaver mechanically inserts template tags in the code while you insert a template object.

NOTE   Macromedia Dreamweaver utilizes HTML comment tags to describe template regions, so template based documents are still valid HTML files.

This section covers the following topics in macromedia dreamweaver:

  • General syntax rules in dreamweaver
  • Template tags in dreamweaver
  • Instance tags in dreamweaver

 

General syntax rules in Macromedia Dreamweaver

Following are general syntax rules:

  • Wherever a space comes into view, you are able to alternate any amount of white space (tabs, line breaks, spaces). The white space is obligatory apart from at the incredibly opening or end of a comment.
  • Attributes are able to given in any order. Such as, in a TemplateParam, you are able to identify the type earlier than the name.
  • Comment & attribute names are case sensitive.
  • All attributes should be in quotation marks. Double or Single quotes are able to used.

For more details about checking your syntax, observe Checking template syntax in dreamweaver.

Related posts of macromedia dreamweaver

  • Template tags in dreamweaver
  • Instance tags in dreamweaver

 

 

Viewing template-based documents in Code view in Macromedia Dreamweaver

Posted by mrshuzan on May 17th, 2012

Viewing template-based documents in Code view in Macromedia Dreamweaver

 

In Code view, editable regions of a document resulting from a template come into view in a dissimilar color than code in the non editable regions. You are able to make modifies just to code in the editable parameters or editable regions; Macromedia Dreamweaver stops you from typing in locked regions.

Editable content is marked in HTML with the following Macromedia Dreamweaver comments:

<!-- InstanceBeginEditable> & <!-- InstanceEndEditable -->

Everything among these comments is editable in a template based document. The HTML source code for an editable region may look like this:

<body bgcolor="#FFFFFF" leftmargin="0">
<table width="75%"  border="1"  cellspacing="0" cellpadding="0">
  <tr bgcolor="#333366">
    <td>Name</td>
    <td><font color="#FFFFFF">Address</font></td>
    <td><font color="#FFFFFF">Telephone Number</font></td>
  </tr>
  <!-- InstanceBeginEditable name="LocationList" -->
  <tr>
    <td>Enter name</td>
    <td>Enter Address</td>
    <td>Enter Telephone</td>
  </tr>
  <!-- InstanceEndEditable -->
</table>
</body>

The default color for non editable text is gray; you are able to select a dissimilar color for the editable & non editable regions in the favorites dialog box. For more details, observe Customizing code coloring preferences for a template in dreamweaver.

Related posts of Macromedia Dreamweaver

  • Viewing templates in Design view in dreamweaver
  • Viewing templates in Code view in dreamweaver
  • Viewing template-based documents in Design view in dreamweaver

 

Viewing template based documents in Design view in Macromedia Dreamweaver

Posted by mrshuzan on May 16th, 2012

Viewing template based documents in Design view in Macromedia Dreamweaver

 

In a document based on a template (a template based document), editable regions come into view in the Document window’s Design view bounded by rectangular outlines in a specific highlight color. A little tab comes into view at the upper left corner of every region, viewing the name of the region.

NOTE   For more details about setting highlighting color favorites, observe Setting highlighting preferences for template regions in dreamweaver.

In adding to the editable region an outline, the whole page is bounded by a dissimilar colored outline, with a tab at the higher right charitable the name of the template that the document is based on. This highlighted rectangle is here to be reminiscent you that the document is based on a template & that you can not modify everything outside the editable regions.

 

Related posts in macromedia dreamweaver

  • Viewing templates in Design view in dreamweaver
  • Viewing templates in Code view in dreamweaver
  • Viewing template-based documents in Code view in dreamweaver

 

1 2 3 4 5 6 7 8 9 10 11 12 ... 41 »

Copyright © 2007 Download Macromedia Dreamweaver. All rights reserved.