Sites menu

From GruppoZenit
Jump to: navigation, search

Z-CMS provides the possibility to create elegant navigation menus supported by styles and images inside each Site that is stored in the program.


Menu Entries can be pointed to site specific Resources as well as to external URLs. Z-CMS also provides option to generate an XML Site Map automatically based on the navigation menu.


Menu Entries in Z-CMS can be "Simple", or created from a Content Model. Simple Menu entries are generated directly from the Menu section of each site managed in Z-CMS. For Content Model Menu entries it is necessary to create and store Content Models inside their respective Site specific areas and then use them for the creation of a Menu entry.


Contents

Simple Menu entries

Simple Menu Entries can be created as follows:

  • From the Site dashboard page go to Sites menu 1.png --> Themes 3.png, a new page opens with fields reported inside the table below:
Field ( * denotes mandatory field) Description
Parent Menu To select the Menu entry under which the particular Menu entry is to be presented. Should be blank if the particular Menu entry which is being created is a top [/first] level one
Page URL* Identifier [Page identifier] of the webpage that is to be pointed by the particular Menu entry. Should be "#" if the particular Menu Entry is not expected to point a webpage or if the particular Menu entry is expected to point an external URL
Page Target [Same Window] / [New Window] – how the Page URL is expected to be opened by the web browser
Sort Order Position at which the particular Menu entry should appear if it is one among many under a Parent Menu entry. Default value is 1000. If there is more than one Menu entry with same Sort Order, their effective Sort Order will be the order in which they are created in Z-CMS
Menu Name [Default language]* Name of the Menu entry [in the default language perspective]. Menu Name is used as the text for the particular Menu entry when it is presented
External URL [Default language] A URL which is not within the Site but to be pointed by the particular Menu entry [in the default language perspective]
Image 1 [Default language] An image which is to be associated with the particular Menu entry [in the default language perspective]
Image 2 [Default language] Another image which is to be associated with the particular Menu entry [in the default language perspective]
Note [Default language] Note [in the default language perspective]browser
… [Other defined languages] Corresponding Menu Name, External URL, Image 1, Image 2 and Note in other defined languages
If a "Page Identifier" is selected as the "Page URL" and hence the particular Menu entry points to a webpage within the Site, Z-CMS enables option to input the following two parameters as well:
Field ( * denotes mandatory field) Description
Menu Identifier A unique identifier for the Menu entry within the Site. Also used as an identifier in the Site URL to refer to the "Page URL" pointed by the particular Menu entry.

Note: Z-CMS will create one internally based on the Menu Name if not supplied

Request Parameters Additional parameter values required [if any] for the "Site specific" resource pointed by the particular Menu Entry
  • Save by clicking the button Sites part 5.png.


As with content data sets for attributes of Content Models, each Z-CMS Menu entry can have a status associated with it. Status can be "Draft", "Preview" or "Publish". Preview is the default one. Exposure of a particular Menu entry in a webpage is controlled by the Status associated with it.


To edit a Simple Menu Entry do the following:

  • From the Site dashboard page select Sites menu 1.png, a page opens with the list of all Menu entries.
  • Go to the Menu detail by clicking on the Menu entry row in the list.
  • Make necessary editing and save.


Example: creation and visualization of a new Simple Menu entry

Consider that we need to create a navigation Menu for a Site with a top level Menu entry named "Products". In this example, "Products" Menu Entry is not expected to point a specific webpage. In order to create a Simple Menu Entry proceed as follows:

  • Click Sites menu 1.png --> Themes 3.png and following page opens:
Sites menu 2.png
In this example, status of the "Products" Menu entry is retained as Preview, the default option.
  • Click Save.


Now, create a Site specific Widget to take the Menu entry and show it inside a webpage. Name the Widget as "Menu" and select its type as "Top" to contain the Menu as follows.

Note: for Menu specific purposes, an internal Content Model named "web_menu" must be used. Further, value for its particular attribute named "standalone" must be set as "true". This is to enable Z-CMS distinguish this internal Content Model from a probable user-defined Content Model named "web_menu".


Aggiungere: esempio piccolo con tag zcms:menu e far togliere riferimenti a Sasib e sigarette


<div id="menu">
   <ul>
      <zcms:content name="web_menu" id="parentMenu" alias="webmenu" standalone="true">
         <zcms:lookup-content name="web_menu_lang" join="inner" alias="WML">
            <zcms:content-relation content-attribute="menu_id" lookup-attribute="menu_id" joinwith="AND"/>
            <zcms:content-relation lookup-attribute="lang_code" value="$request[language]" />
         </zcms:lookup-content>
         <zcms:datacolumn name="WML.menu_name" alias="menu_name" />
         <zcms:datacolumn name="webmenu.menu_name" alias="menu_name1" />
         <zcms:filter attribute="fk_menu_id" value="IS NULL" plaintext="true" clause="true"/>
         <zcms:datacolumn name="webmenu.menu_id" alias="menu_id" />
         <zcms:dataorder attribute="sort_order" order="asc" /> 
         <zcms:filter attribute="website_id" value="$session[site]" />          
         <zcms:is operation="EQUALS" attribute="menu_identifier" value="$request[$1]">		  	
            <zcms:escape>
               <li class="selected">
            </zcms:escape>
            <zcms:else>
               <zcms:escape>
                  <li>
               </zcms:escape>
            </zcms:else>			
         </zcms:is>
         <zcms:is attribute="EXTERNAL_URL" operation="NOT_EMPTY">
            <zcms:escape>
               <a class="menu_first" href="#[zcms:attribute:EXTERNAL_URL]" target="_blank">
            </zcms:escape>
            <zcms:else>
               <zcms:escape>
                  <a class="menu_first" href="[zcms:attribute:page_url]">
               </zcms:escape>
            </zcms:else>
         </zcms:is>
         <p><span><zcms:attribute name="menu_name" /></span></p>
         <zcms:escape>
            </a>
         </zcms:escape>
         <zcms:content name="web_menu" id="childMenu" standalone="true">
            <zcms:lookup-content name="web_menu_lang" join="inner" alias="WML">
               <zcms:datacolumn name="WML.menu_name" alias="menu_name" />
               <zcms:content-relation content-attribute="menu_id" lookup-attribute="menu_id" joinwith="AND"/>
               <zcms:content-relation lookup-attribute="lang_code" value="$request[language]" />
            </zcms:lookup-content>
            <zcms:datacolumn name="WEB_MENU.menu_id" alias="menu_id" />
            <zcms:dataorder attribute="sort_order" order="asc" />
            <zcms:filter value="$result[*parent, menu_id]" attribute="fk_menu_id" />
            <zcms:begin>
               <zcms:escape>
                  <ul><li>
               </zcms:escape>
            </zcms:begin>
            <zcms:is operation="EQUALS" attribute="menu_identifier" value="$request[$2]">
               <zcms:is attribute="EXTERNAL_URL" operation="NOT_EMPTY">
                  <zcms:escape>
                     <a class="selected" href="#[zcms:attribute:EXTERNAL_URL]" target="_blank">
                  </zcms:escape>
                  <zcms:else>
                     <zcms:escape>
                        <a class="selected" href="[zcms:attribute:page_url]">
                     </zcms:escape>
                  </zcms:else>
               </zcms:is>
               <zcms:attribute name="menu_name" /> 
               <zcms:escape>
                  </a>
               </zcms:escape>
               <zcms:else>
                  <zcms:is attribute="EXTERNAL_URL"operation="NOT_EMPTY">
                     <zcms:escape>
                        <a href="#[zcms:attribute:EXTERNAL_URL]" target="_blank">
                     </zcms:escape>
                     <zcms:else>
                        <zcms:escape>
                           <a href="[zcms:attribute:page_url]">
                        </zcms:escape>
                     </zcms:else>
                  </zcms:is>
                  <zcms:attribute name="menu_name" /> 
                  <zcms:escape>
                     </a>
                  </zcms:escape>
               </zcms:else>
            </zcms:is>
            <zcms:end>
               <zcms:escape>
                  </li></ul>
               </zcms:escape>
            </zcms:end>
         </zcms:content>
         <zcms:close name="childMenu" />
         <zcms:escape>
            </li>
         </zcms:escape>   
      </zcms:content>
      <zcms:close name="parentMenu" />
   </ul>
</div>

Include the Widget in desired webpages as follows:

<zcms:include menu="Menu" type="Top"></zcms:include>

Now, for a quick preview of the Menu entry just created, go to "Site specific" resources, locate a webpage (xhtml) in the resources list that has the Widget included and click the preview Resources 6.png button associated with it to get something similar to:

Sites menu 3.png

Content Model Menu entries

Z-CMS also provides option to create Menu entries based on Content Models and Attribute content data sets in addition to Simple Menu entries. This means that in Z-CMS it is possible to manage the creation of lookup relationships between Attributes belonging to different Content Models.


Example: creation and visualization of a Menu entry based on a Content Model

In this example, the "Products" Menu entry will be added a "Product Category" entry under it. The Product Category Menu entry will be based on attribute data of a "Product Category" Content Model. Product Category Menu Entry is expected to point a webpage that loads all products belonging to the particular category.


Considering a Simple Menu Entry creation as explained above, Attribute Content Data Set based Menu entry creation enables option to input the following parameter as well:

Field ( * denotes mandatory field) Description
Content Identifier A unique identifier for the "Attribute Content Data Set" to associate with the corresponding Menu entry.

Also used as an identifier in the Site URL to refer to the "Attribute Content Data Set" associated with the particular Menu entry. Note: Z-CMS will create one internally if not supplied

An Attribute Content Data Set Menu entry creation is illustrated below as a progression of the previous example used to explain the Simple Menu entry creation.


From the Site dashboard page go to Content Model 1.png and create a "Product Category" Content Model. Consider that the Product Category Content Model named "Prod_Cat" is stored as follows:

Sites menu 4.png

Now, a Menu entry can be created under the top level Simple Menu entry named "Products" based on the Content Data for the attributes of the "Prod_Cat" Content Model by doing the following:

  • Input Content Data for desired attributes according to the image below:
Sites menu 5.png
  • Click Sites menu 6.png at the top right of the page and input values for the Menu entry parameters appropriately:
Sites menu 7.png
Menu entry "Cigarette Makers" (a Product Category) is expected to load a webpage named "product_list" that can load Products belonging to the particular category.
  • Click Save.
  • Save the Content Data for the attributes.

Now, for a quick preview of the Menu entry just created, go to the Site specific resources, locate a webpage (xhtml) in the resources list that has the Widget containing the Menu included and click the preview button Resources 6.png associated with it. The Following picture of the menu will show in preview:

Sites menu 8.png

A particular Content Model can also be configured to enable automatic Menu entry creation for each of its Attribute Content Data Sets. In this case, every time contents are added to attributes of that specific Content Model, they are automatically added as Menu entries.


This can be obtained in the following way:

  • Go to Content Model location from the Site dashboard page and open one specific Content Model by selecting the relative row. The following page opens (in this case the same Content Model used for the previous example above):
Sites menu 9.png
  • Click Sites menu 6.png at the top right of the page and input values for the Menu entry parameters appropriately:
Sites menu 10.png
In this case, the fields "Page URL", "Menu Name" and "Parent Menu" are mandatory.
Menu Name denotes the particular attribute of the Content Model whose content data is to be used as the name and text of the particular Menu entry realized.
  • Click Save at the top of the window.
  • Save the Content Model.


Now, input Content Data for the attributes of the Content Model from the Content Manager section. Since the Content Model is configured to be automatically inserted inside a menu, when contents are added to the Content Model, they are added as Menu entries.

Sites menu 11.png

Clicking Sites menu 6.png button now will disclose the automatic Menu entry configuration that is taking place internally.

Sites menu 12.png
  • Click Save or Cancel inside the Menu window.
  • Save the Content Data for the attributes .


Creation of a Site Map

Z-CMS allows the creation of an XML Site Map based on the navigation menu. To create that map the following operations are needed:

  • From the Site dashboard page select the label Sites menu 1.png and open the page with all Menu entries.
  • Click Sites menu 13.png button at the top of the page.
Now the sitemap XML file will be available inside the Site Resources at Sites menu 14.png inside the list under the name "Sitemap" and type "xml".


Site Map generation of a particular Site can be attempted any time after storing at least one navigation Menu. Each attempt will generate a Site Map based on the current navigation Menu configuration of the Site. Further, each newly generated Site Map will replace the previously generated one.


Stored Sitemap XML files can be reviewed as follows:

  • Go to the Resources list by selecting label Sites menu 14.png from the Site dashboard page.
  • Go to the Site Map detail by clicking on the Site Map row with Name="Sitemap" and Type="xml" in the list.

Note: sitemap XML file will be available for web crawlers as default at the context root folder of the Site after "Publish".


See also

Personal tools
Namespaces

Variants
Actions
Toolbox