Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

How-To Tutorials - Web Development

1802 Articles
article-image-drupal-6-performance-optimization-using-db-maintenance-and-boost-part-1
Packt
23 Mar 2010
8 min read
Save for later

Drupal 6 Performance Optimization Using DB Maintenance and Boost: Part 1

Packt
23 Mar 2010
8 min read
These are not required modules, but rather are recommended modules to add to your Drupal performance arsenal. The way this article will work is that we'll outline the purpose of each module, install and configure it, and then use it on a specific topic, for example, within your site. This will give you some practice using contributed Drupal modules and also a look at the variety of performance based modules that are available from the Drupal project community. Using the DB Maintenance module The DB Maintenance module can be used to optimize your MySQL database tables. Depending on the type of database you are running, the module allows you to use a function called OPTIMIZE TABLE, which troubleshoots and then optimizes various errors in your MySQL tables. For MyISAM tables, the OPTIMIZE TABLE will repair your database tables if they have deleted rows. For BDB and InnoDB types of tables the function will rebuild the entire table. You can use this module in tandem with phpMyAdmin to determine if you do or do not need to optimize your database tables. The benefit of this module is that it allows you to keep your database optimized and defragmented, similar to keeping your computer hard drive optimized and defragmented so that it runs faster, and you can do all this from the Drupal administrative interface. The project page where you can download the module is here: http://drupal.org/project/db_maintenance. Download the module tar.gz and extract it to your desktop. Then, upload the files through FTP, or upload and extract using a cPanel utility if your host provides this. The module should go in your /sites/all/modules directory. Once you upload and extract the module folder, enable the module on your modules admin page and save your configuration. We'll use the version that's recommended for Drupal 6.x, which is 6.x-1.1. You can try out the beta version, but you should not run this beta version on a production level website unless you've tested it sufficiently in a sandbox environment. Once you save your module configuration, you'll notice that the module adds a link to its settings and configuration page under your main Site configuration section. Go to Site configuration | DB maintenance to access the configuration admin screen for the module. The DB maintenance screen will contain a checkbox at the top allowing you to log OPTIMIZE queries. If you check this box, your watchdog log entries module will log all table optimization entries and give you detailed information on the tables that were optimized. At the time of writing this article, the 1.1 version of the DB Maintenance module contained bugs that caused glitches with the method of adding this module's queries to the recent log entries or prevented this entirely. You may also experience these glitches. The module's developers are aware of the issues because they have been posted to the issue queue at http://drupal.org/ on the module project page. Let's go ahead and check this box. You can then select the frequency with which you would like to run the optimization. The choices are daily, Run during every cron, Hourly, Bi-Hourly, Daily, Bi-Daily, Weekly, Bi-Weekly, Monthly, and Bi-Monthly. You can also click on the Optimize now link to force the optimization to occur immediately without scheduling in advance. We'll click on this link for the purpose of this demo, but in future you may want to schedule the optimization. We'll then run a cron job through the Status report, or a module such as Poormanscron, and the tables will be optimized. Next, you can select the tables in your Drupal database that you want to optimize. A nice feature of this module is that it allows you to multi select database tables, only select a few tables, or just one table. This gives you the same flexibility and functionality as your phpMyAdmin tool, but you can run everything from within your Drupal interface. It's like a phpMyAdmin lite version right in your Drupal site. This is a preferred option for those developers who may not have immediate access to a client's phpMyAdmin or a host's database management utility. Choose a selection of tables that you want to optimize, or select all the tables. For this demo I'm going to optimize all of my content type tables, so I'll select all of those. I'll also optimize my block tables: blocksblocks_rolescontent_type_blogcontent_type_bookcontent_type_forumcontent_type_pagecontent_type_photocontent_type_pollcontent_type_storycontent_type_webform Once you've selected the tables you want to optimize, click on the Optimize now link. As with any module or optimization enhancement that you make to your Drupal site, it is good practice to run a full backup of your MySQL database before performing any maintenance, including optimizing tables using the DB Maintenance module. This way you will have a full backup of your data if you run into any issues that the module could potentially create. It's better to play it safe and perform the backup first. Once you click on the Optimize now link, you should receive a message notifying you that the Database tables are optimized. This concludes our discussion and walkthrough of using the DB Maintenance module. Let's now turn to the Boost module and use it to speed up our site page and content loads. Using the Boost module We' re going to turn our attention to the Boost module in this section. Boost is a contributed module that allows you to run incredibly advanced static page caching on your Drupal site. This caching mechanism will help to increase performance and scalability on your site, especially if it gets heavy traffic and anonymous page visits, and it is on a shared hosting environment. This is usually the first contributed performance-based module to turn to for help when you host your Drupal site on a shared server. Developers running Drupal sites on shared servers and running sites that serve predominantly anonymous Drupal users will definitely want to try out this module. It's also a fun module to use from a technical standpoint because you can see the results immediately, as you configure it. The Drupal project page for the module is here: http://drupal.org/project/boost. There is a wealth of detailed information about the module on this project page, including announcements about upcoming conference presentations that focus on the Boost module, testimonials, install instructions, and links to documentation and associated modules that you may want to run alongside Boost. It is very popular and has quite a following in the Drupal development community. I definitely recommend reading about this module and all of its install and configuration instructions in detail before attempting to use it. The install paragraph suggests reading through the module README.txt file before running the install for details on how the module works. There are also detailed instructions and documentation on the module here: http://drupal.org/node/545664. Note that the one requirement to use this module is that your Drupal site must have clean URLs configured and enabled. It's a good idea to make sure you are running clean URLs on your site before you start installing and configuring Boost. Additionally, there are some recommended modules that the developers encourage you to install in tandem with the Boost module. We will install two of these modules: Global Redirect and Transliteration. The Global Redirect module runs a number of checks on your website including the following: Checks the current URL for a Drupal path alias and does a 301 redirect to the URL if it is not being used. Checks the current URL for a trailing / and removes the slash if it's present in Drupal URLs. Checks if the current URL is the same as the site's front page and redirects to the front page if it locates a match. Checks to see if you are using clean URLs. If you do have clean URLs enabled, this module ensures URLs are accessed using the clean URL method rather than an unclean method (for example, ?q=user). Checks access to the URL. If a user does not have permissions to view the URL, then no redirects are allowed. This helps to protect private URL aliases. Checks to ensure the alias matches the URL it is aliasing. So, if you have a URL alias such as /about and this directs to node/23, then a user on your site can access the page using either of those URLs. The Transliteration module removes white space and non-ASCII characters in your URLs. For example, it will try and add underscores to fill white space in a URL. Installing and enabling these two modules will help remove glitches and errors in your site's path structure. If you haven't already, we'll also take the time now to install the Poormanscron module and set up and configure automatic cron runs instead of having to continue running cron manually. We'll return to installing and configuring Poormanscron later in this article, but just keep it on your radar for now. Let's go ahead and install the Boost module and take a closer look at some of its features.
Read more
  • 0
  • 0
  • 3410

article-image-organizing-your-content-effectively-using-joomla-15
Packt
23 Mar 2010
8 min read
Save for later

Organizing your Content Effectively using Joomla 1.5

Packt
23 Mar 2010
8 min read
Building on the example site It's time to make room for growth. Your client has a big pile of information on ugly art that they want to present to the public. You are asked to design a site framework that makes it easy to add more content, while at the same time keeps it easy for visitors to quickly find their way through the site. Can you do that? You most certainly can! Joomla! allows you to build sites of all sorts and sizes, whether they consist of just a few pages or thousands of them. If you plan ahead and start with a sound basic structure, you'll be rewarded with a site that's easy to maintain and extend. In this article, we'll review the site you've just built and look at the different ways the content can be structured—and rearranged, if need be. Grouping content: A crash course in site organization To lay the groundwork for your site, you won't use Joomla!. The back of a napkin will do fine. Draw up a site map to lay out the primary content chunks and their relationships. View your site from a user's perspective. What do you think your visitors will primarily look for, and how can you help them find things fast and easily? Designing a site map To create a site map, first collect all information you plan on having on your website and organize it into a simple and logical format. As site maps come, this is a very basic one. For the most part, it's just one level deep. Introducing Ugly Paintings and Mission are basic web pages (articles). Activities is a section that allows the visitor to browse two other categories. Contact Us is a contact form page. This structure was good enough for a basic website, but it won't do if SRUP wants to expand their site. Time for action – create a future proof site map Let's make some room for growth. Imagine your client's planning to add an indefinite amount of new content, so there's a need for additional content containers. They have come up with the following list of subjects they want to add to their site: News items A few pages to introduce the founding members of SRUP Reviews on ugly art Facts on ugly paintings (history, little known facts, and so on) What's the best way to organize things? Let's figure out which content fits which type of container. Step 1: You'll probably want to create a separate News section. News should be a top level item, a part of the site's main menu.     Step 2: The information on the SRUP founders fits in a new section 'About SRUP'.   Step 3: Both Reviews and Facts can be categories in a new general section on 'Ugly Paintings'. The existing article 'Introducing Ugly Paintings' could be moved here (or dropped).     What just happened? You've laid a solid foundation for your site—on paper. Before you actually start using Joomla! to create sections and categories, create a structure for the content that you have in mind. Basically, no matter how big or small your website is, you'll organize it just like the example you've just seen. You'll work from top to bottom, from the primary level to the lower levels, defining content groups and their relations. Bear in mind, though, that there will certainly be more than one way to organize your information. Choose an organization that makes sense to you and your visitors, and try to keep things lean and clean. A complex structure will make it harder to maintain the content, and eventually—when building menus—it will make it harder to design clear and simple navigation paths for your visitors. Tips on choosing sections It can be useful to choose sections based on the main intentions people have when they come to the site. What are they here for? Is it to Browse Products or to Join a Workshop? Common choices for sections are: Products, Catalog, Company, Portfolio, About Us, Jobs, News, and Downloads. Try not to have more than five to seven sections. Once you have more than that, readers won't be able to hold them all in their heads at once when they have to choose which one to browse. Transferring your site map to Joomla! Let's have a closer look at our new site map and identify the Joomla! elements. This—and any—Joomla! site is likely to consist of five types of content. The following are the content types in our SRUP site map:   Obviously, the top level item will be the home page. The main content groups we can identify as sections and categories. This small site has four sections, three of which contain two categories. Each of the categories hold actual content: this is what will end up in Joomla! as articles. In this site map, there is one article that doesn't really belong in any category: the Mission Statement page. Every site will have one or two of those independent articles. In Joomla!, you can add these as uncategorized articles. Finally, there's one item that represents a very different type of content. In the site map above, a grey background indicates an item containing special functionality. In this case this is a contact form. Other examples are guest books, order forms, photo galleries. Basically, that's all there is to a Joomla! site. When you've got your site outlined like this, you won't meet any surprises while building it. You can transform any amount of content and functionality into a website, step by step.   How do you turn a site map into a website? If you've got your site blueprint laid out, you probably want to start building! Now, what should be the first step? What's the best, and fastest, way to get from that site map on the back of your napkin to a real-life Joomla! site? In this book, we'll work in this order: Organize: Create content containers.You've seen that much of the site map we just created consists of content containers: sections and categories. In this article, we'll focus on these containers. We'll create all necessary containers for our example site. Add content: Fill the containers with articles.Next, we'll add articles to the sections and categories. Articles are the "classic content" that most web pages are made of. We should also check for articles that do not belong in any category. Instead of assigning them to a section and a category, we'll add them as Uncategorized content.. Put your contents on display: Create the home page and content overview pages.Next, you'll want to guide and invite visitors. You can achieve this using two special types of pages in the site map, the home page and Joomla!'s section/category overview pages ("secondary home pages"). Make everything findable: Create menus.The top level items in your site map will probably end up as menu items on the site. To open up your site to the world you'll create and customize menus helping visitors to easily navigate your content. And what about the special content stuff? You'll notice that in the above list we've summed up all sorts of "classic content", such as articles, home pages, overview pages, and menus linking it all. We haven't yet mentioned one essential part of the site map, the special goodies. On a dynamic website you can have more than just plain old articles. You can add picture galleries, forms, product catalogues, site maps, and much, much more. It's important to identify those special pages from the beginning, but you'll add them later using Joomla!'s components and extensions. That's why we'll first concentrate on building a rock-solid foundation; later we'll add all of the desired extras. Let's start with step one now, and get our site organized! Creating content containers: Sections and categories To create a section, navigate to Content | Section Manager | New. To make a new category, you'll use the Category Manager instead. Just add a title for your new section or category and click on Save. You've created a perfectly workable section or category with the default settings (or parameters as Joomla! likes to call them). Time for action – create a new section and a category Your client was happy with the initial site structure you designed, but now their website is evolving, there's a need for more content containers. Let's add a news section first: Navigate to Content | Section Manager and click on New. In the Section: [New] screen, fill out the Title field. In this example, type News: Leave the other values unchanged; click on Save. You're taken to the Section Manager. The News section is now shown in the section list. Now, add a category to the new section. We'll call this category General News: Navigate to Content | Category Manager and click on New. In the Title field, type General News. In the Section field, select News. Click on Save. You're done!
Read more
  • 0
  • 0
  • 4610

article-image-installation-drupal-and-ubercart-2x
Packt
23 Mar 2010
4 min read
Save for later

Installation of Drupal and Ubercart 2.x

Packt
23 Mar 2010
4 min read
You don't have to be an expert programmer or a system administrator in order to complete the following process. We'll first give you a brief explanation of the underlying technologies, and then we'll continue with a step-by-step guide. At the end of this article, you'll have the online store installed on your local or remote machine and you'll be ready to make all the required customizations to the frontend and the backend, depending on your needs. Minimum requirements for Ubercart installation In order to successfully install and use your online store, your system must meet the following requirements: Operating system: Drupal works fine in almost every operating system. Actually, you can transfer your Drupal installation from one operating system to another within minutes and no customization is required at all. All you have to do is to move the files and the database without altering any configuration files. For example, you can install Drupal on your local Windows or Mac computer, do all the customizations there, and then upload it to a Linux server to go live. Web server: The web server is the software that accepts HTTP requests from browsers and delivers web pages to the users of our site. The most popular web server is Apache and we'll use it for our installation. It's secure, extensible, fast, and easy to customize. If you're not an expert in another web server, there is no reason to think of any other solution, because most of the available information and support is about Apache. Database: The purpose of the database is to store, organize, manage, and retrieve all the data of our website in a structured way. When referring to data, we mean not only the content that you put in your pages, but also every piece of information that Drupal uses for all its functions. In this book, we're using MySQL as a database. Today, it's the #1 open source database, and it's used in millions of websites and applications, from small personal web pages to enterprise systems with millions of users.The MySQL database of a basic installation contains about 50 tables and every new installed module creates one or more new tables. If you check your database after the installation of Ubercart, you'll find that there are 100 tables in your database. These tables contain data such as pages, products, images, categories, orders, payments, caching information for your pages, theming information, comments from your visitors, menus, user information, and so on. PHP: PHP is a scripting language, ideal for web development. It began as a small personal project, but soon became a very popular scripting language. Drupal is written in PHP, so it's absolutely necessary and there is no alternative to it.Some PHP extensions are needed for our installation. We'll mention them briefly here, so you can consult your hosting provider or examine your local system to check that everything is fine. The easiest way to check your PHP parameters is to use phpinfo. It's a function that returns information about the PHP environment on your server. All you have to do is to create a blank file named phpinfo.php in your server and insert the following code using a text editor: <?php phpinfo (); ?> This is a small PHP script that runs the phpinfo function and displays the results on your screen. If you browse to phpinfo.php, you'll see a page with your PHP configuration. The basic PHP requirements are: PHP memory requirements: 1 6 MBs are enough for basic sites; however, 64 MBs are recommended for more complex installations. GD2 library: GD2 is an image manipulation library for PHP. Ubercart needs this library, so if we want to put images to our products, it has to be installed. Register Globals: This is actually a depreciated PHP feature, but some hosting providers with old systems still use it. It's a security risk, so it has to be disabled for Drupal to install. Safe mode: Drupal 6 doesn't support PHP's safe mode, because it causes problems to file uploads, so it also has to be turned off.
Read more
  • 0
  • 0
  • 2086

article-image-alfresco-web-content-management-wcm-20-part-one
Packt
19 Mar 2010
9 min read
Save for later

Alfresco Web Content Management (WCM) 2.0 Part One

Packt
19 Mar 2010
9 min read
Web Content Management (WCM) Modern web site implementations are architected with two distinct sets of capabilities – creation and maintenance of the content and delivery of the content to the target audiences. Creation and maintenance of web content is called Web Content Management (WCM) and is a relatively new discipline in the history of web technology.   In the early days, web sites were simple with static content that changed infrequently. Modification of the content was not the biggest of challenges and such changes were typically performed by technical developers. Web technology and the associated disciplines have come a long way since those times. Today there are well-defined disciplines involved in creation of web presence such as information architecture, visual design, content strategy, and site development. Products of these disciplines are merged together and realized through enterprise application technology, which adds functionality and dynamic nature to web sites. Specialization of roles among these disciplines as well as the complexity of the modern technology has made content updates difficult and error prone when performed directly on stored content. A WCM system makes it easier to create and update content by hiding the technical details related to the storage and delivery of content. It becomes almost imperative to use a WCM system for sites that have highly dynamic content which may also need to be delivered on multiple channels such as web, handheld devices, and print media. In such situations, content can be created once and rendered automatically for different channels. The WCM products available today vary widely in terms of their capabilities, the underlying technologies and frameworks, and the extent to which they use open-source products as architecture components. Many WCM systems also offer presentation capabilities in order to facilitate delivery of content at least for the web medium. When discussing WCM features, it is useful to identify what WCM is and what it isn’t. WCM deals with creation, persistence, and maintenance of content. It may also include some support for presentation in terms of previewing the content being created or edited. However, fully-featured presentation frameworks or technologies, such as portals, should be evaluated separately, since majority of their concerns are significantly different. Products with integrated WCM and portal capabilities offer the convenience of a one-stop solution for building, managing, and delivering web content. On the other hand, products with only WCM capabilities, or at least clearly separable WCM capabilities, offer freedom to use rich and mature presentation technologies which may already be in place in the existing infrastructure. Let’s take a look at a few products, which represent various points along the spectrum between these two extremes. Microsoft SharePoint Server is a well-known product with a wide range of content management capabilities that go beyond WCM and portals. Similarly, EMC Documentum is a high-end platform for enterprise content management which can be used in almost any way enterprise content may be intended to be used. EMC Documentum provides products catering to specialized needs – Web Publisher for creating and managing web content, Site Caching Services for pushing content to Web or Application Servers, and integration options with portals for presenting content. Interwoven and Vignette also offer high-end WCM systems. There is also a wide range of open-source options for WCM which have developed large user bases. Joomla! (as well as Mambo, where Joomla!’s origins lie) offers an integrated WCM and portal technology built on the LAMP (Linux, Apache, MySQL, PHP) platform. Joomla! offers over 100 components for providing specific optional capabilities such as building user communities or incorporating shopping carts. Joomla! makes it very easy to set up a web site in minutes if you are willing to work with its content organization and presentation model. Alfresco is an open-source platform developed with the stated goal of bringing enterprise content management (ECM) capabilities to open source. The Alfresco leadership team brings content management experience from companies such as Documentum, Business Objects, and SeeBeyond. Alfresco has matured with two major releases over a period of 2.5 years. Alfresco enables Document Management, Collaboration, Records Management, Knowledge Management, Web Content Management and Imaging – some of the most common applications of enterprise content management. Alfresco WCM 2.0 was released recently and offers some exciting built-in features that promote development efficiency and reduce infrastructure demands. We will explore these aspects in this article.   WCM Challenges Every WCM system is expected to provide certain fundamental features. The core WCM feature is the ability to edit content through a user-friendly and technology-neutral (as much as possible) interface. The system also needs to provide security and the capability to allow a team to work on the content. WCM systems typically support versioning for content items. Finally, the content needs to be exported to a form suitable for web or application servers for delivering to the target audiences. There are certain other features that are not necessarily required in a WCM system, but are considered to be desirable and are supported by many contemporary WCM products. One such feature is the ability to store content in XML format. XML content facilitates publishing the same content through multiple channels such as web, wireless devices, and print media. Another common and desirable feature is the support for business processes or workflows. At the minimum a simple approval process is desired which can be used to review and approve the promotion of content changes to a live environment. The WCM features discussed so far focus on what a WCM system can do. However, some of the challenges for WCM initiatives deal with how a WCM system supports certain capabilities. Such aspects may significantly affect development efficiency, quality assurance, and infrastructure costs. We take a look at some of these concerns below. Simple static HTML pages seem to belong to a bygone era. Even simple web sites today are usually dynamic and frequently contain media (images, videos) and utilize code and a database. Today, web site management deals with managing content, media, and code together. As a result, the line separating a web application from a web site is a blur. Note that sometimes the term “content” is used to refer to all the resources managed by a CMS. For sites utilizing code and media along with plain content, it becomes important that all of these resources are managed in sync. For example, if a change is made to include a new user attribute in the user profile the corresponding code or configuration changes need to make it to the live environment, along with any presentation changes (web pages that will use this new attribute). These requirements become more complex when you consider the fact that different team members may be working on related artefacts and these changes need to go through the review process concurrently. Another aspect of managing dynamic web sites is that often multiple web pages need to change to reflect one feature change in the web site. For the example above, the new user attribute may require a change to the user registration screen, user profile screen, and possibly some site functionality that utilizes the given feature. Thus, adding an email format preference to the user profile may require changes to three pages, two code components, and one configuration file. These affected artefacts together form a change set – they all need to go into the web site together or none of them should. If one or more pieces in the change set were left out, the change would not function as expected and would likely introduce a bug. Change sets bear some similarity to transactions and versions. The description above reflects the similarity to a transaction since all the changes should either be committed or discarded together. On the other hand, suppose a change set implementing a particular feature was promoted to the live environment. It worked as designed and expected. However, it led to unexpected business impacts and now this change needs to be undone. The WCM system should make it easy to roll back the changes introduced by a change set. If the system kept track of web site snapshots – state of the complete site after each change set was promoted, it would be simpler to go back to a prior state of the web site. One of the trickier challenges of WCM systems is to provide multiple environments which are isolated but more or less similar in structure. For example, each developer requires an area where he/she can make changes without impacting other developers or to the live environment. However, each developer should only see his/her changes on top of the currently live content. Then multiple change sets might need to be reviewed by different reviewers concurrently. Each reviewer should only see the change set to be reviewed on top of the currently approved content. Thus, there is a need for an on-demand virtual copy of the web site which includes the approved content and a change set. Such an isolated environment is commonly referred to as a sandbox. In the rest of this article, we will explore the core features offered by Alfresco WCM 2.0 and how it addresses the WCM challenges described above.   Alfresco WCM 2.0 Alfresco is an open-source content management platform. Alfresco WCM 2.0 is an optional add-on which can be installed on top of the core platform to enable WCM capabilities. In this section, we will look at typical usage of Alfresco WCM 2.0 and highlight how it handles the challenges described earlier. Alfresco organizes storage in spaces. A space is a smart folder which can be associated with configurable rules. These rules control what happens to documents or other spaces that are added under the space. Among other things, these rules enable workflows within the platform, support automatic versioning, and automatic rendition generation.   Installing Alfresco WCM 2.0 adds two spaces to the repository – Web Projects and Web Forms, as shown below in the Alfresco standard web interface. The Web Projects space holds other spaces, where each space represents one web site. The Web Forms space holds templates for creating and publishing content for different content types such as a press release or a company profile.                           Two Spaces are Added by Alfresco WCM 2.0 Web content for a site is managed under a web project space which is created under Web Projects. For example, the following screenshot shows alfrescowww as a space created for managing content for this web site. A Space for Holding Content for a Web Site Continue reading Alfresco Web Content Management (WCM) 2.0 Part Two [ 1 | 2 ] Read Alfresco Web Content Management (WCM) 2.0 Part OneRead Alfresco Web Content Management (WCM) 2.0 Part Two
Read more
  • 0
  • 0
  • 2607

article-image-alfresco-web-content-management-wcm-20-part-two
Packt
19 Mar 2010
6 min read
Save for later

Alfresco Web Content Management (WCM) 2.0 Part Two

Packt
19 Mar 2010
6 min read
The Web Forms space holds forms that define content templates. For example, we may want press release to be a content type for the web site. A press release may contain a title, an abstract, a location, and several paragraphs in the body. These content elements can be defined in an XML schema file. Alfresco WCM uses the information in the schema file to automatically create a form which can be used for creating XML content for press releases. Once this content is created it can be published to multiple channels –web site, plain text, and wireless devices such as cell phones, for example. The publishing conversion for each channel can be defined using transformations which are specified using XSL, among other options. Content templates can be shared across multiple web sites. The following figure illustrates how a content item for a content type is created and published for multiple channels. Creating Content and Publishing on Multiple Channels for One Content Type Once the space for web site and the web forms (content templates) have been set up, we need to set up users with appropriate content development roles. For example, different users may play roles such as Content Publisher, Content Reviewer, and Content Manager in the content creation process. Further, a Web Developer role may perform the necessary setup needed prior to content creation. Alfresco supports the concepts of change set and sandbox described earlier. Each user gets a separate sandbox, which is an isolated view of the web site. Each user’s sandbox shows only that user’s changes on top of the existing approved content. Similarly, when a user needs to approve a set of changes only those changes need to be visible on top of the approved content. A change set is a set of changes that move together in a workflow. The following screenshot shows user sandboxes and the staging sandbox which contains the currently approved content. The Modified Items link shows the content items the user is currently working on. Staging and User Sandboxes Note how each of the sandboxes allows a separate preview of the website incorporating the changes present in that sandbox. The preview of staging sandbox consists of only the approved content. Alfresco WCM 2.0 includes a virtualization mechanism for supporting in-context web site previews. For example, the following screen shows a preview of the Staging Sandbox web site. Note that there is one approved press release. A Published Press Release in Preview Another, very useful feature of Alfresco WCM 2.0 is snapshots. A snapshot captures the complete state of the web site at a given point in time – it can also be thought of as a version of the web site. Alfresco allows reverting back to an older snapshot with just one click. The figure below shows how easy it is to revert to an older snapshot – version 8 was created by clicking on Revert in the row for version 4.   Reverting to a Prior Web Site Snapshot In version 4, the news story shown earlier had not been approved. Previewing the web site for Staging Sandbox now shows no press release in the screenshot below. Previewing the Staging Sandbox after Reverting to an Old Snapshot Note that security and workflow capabilities are part of the core Alfresco platform and are utilized by WCM 2.0. The features discussed above focus on the core development process where content is created via web forms and goes through the approval process, allowing site preview at every point. However, Alfresco WCM 2.0 architecture is versatile enough to allow content creation through standard interfaces such as WebDAV and CIFS (Common Internet File System). Further, it allows content delivery to multiple sites and supports multiple web application technologies. The following figure illustrates these capabilities of the Alfresco architecture. Source: Alfresco WCM Webinar, March 2007 Note that the terms Dev, Preview and Live in the figure above represent the creation of code, content, and media and their movement through the approval process. The Alfresco server shown in the middle is one production environment. In reality, you would need one or two additional environments for performing configurations and customizations in a separate environment which will not accidentally bring your production system down. For example, you should rehearse the space structure setup, security setup, custom rules and configurations in a development environment. Ideally, you would replicate the setup in a QA environment where the configurations/customizations can be tested before applying to the production environment. The development environment remains the playground for trying out any new configuration or customization. The environment concerns described above are not unique for Alfresco WCM 2.0 – there are fairly similar concerns in other WCM systems. What is really pleasant about Alfresco is that it is lightweight enough to run on a single physical machine for dev and QA purposes. On the other hand, production can be set up in truly sophisticated configurations to handle performance, availability, and disaster recovery requirements. Further, Alfresco’s ability to use various commercial components (database, application servers, etc.) as well as popular robust open-source alternatives liberates customers by giving them back the power and freedom to choose what is best for their technical environment.   Conclusion Web Content Management is one of the most popular applications of Enterprise Content Management. There is a wide range of WCM products available in a spectrum ranging from open-source products to completely proprietary offerings. Alfresco WCM 2.0 is a recent release which makes secure content management in a team environment a breeze. It offers exciting features which enable content managers to review, approve, and roll back business or application-level features. This is a huge improvement over managing content, media, and code at an individual file level. The Alfresco WCM 2.0 architecture takes the pain out of adding content from various sources as well as delivering content to multiple channels. The underlying Alfresco architecture puts the power and freedom of choice back in the customer’s hands by liberating them from vendor lock-in. By building upon robust open-source technologies Alfresco leaves more cash in the customers’ pockets for completing their strategic content management initiatives successfully.   References and Resources   Alfresco 2.0 Web Content Management Product Evaluation Guide Book – Alfresco Enterprise Content Management Implementation Alfresco WCM Webinar, March 2007 Alfresco 2.0.1 and 2.1.0 Update Alfresco.com
Read more
  • 0
  • 0
  • 1720

article-image-roles-alfresco-14
Packt
19 Mar 2010
9 min read
Save for later

Roles In Alfresco 1.4

Packt
19 Mar 2010
9 min read
Roles in Alfresco 1.4   The article explains the basics involved in understanding Alfresco authorization and the means to extend its functionality, for example, to adapt it for any special requirements through configuration files. The concepts explained in the article will be useful for anyone who has started working with Alfresco code. In addition to this, a little step-by-step example towards the end helps you extend the initial Alfresco roles. Read out more in the article written by Alfonso Martin. Once you have started with Alfresco, you will realize that you need to create or expand the default roles included with Alfresco. This task (at this moment) must be done manually through configuration files. Before diving into the Alfresco.war file to search for the property configuration files, you will need to understand a few concepts. This article will introduce you to the basics in Alfresco's role policy. The basic concept in action authorization in Alfresco is that of permission. Permissions dictate when an action can be executed on an object by a user. Key concepts in defining authorization policy in Alfresco are: PermissionSets PermissionGroups Permissions GlobalPermissions Such elements are declared in the permissionDefinitions.xml file, located in WEB‑INF/classes/alfresco/model inside the Alfresco.war file. PermissionSet Collections of permission groups, permissions, and dynamic authorities with common attributes: type: (Mandatory) PermissionSet is defined over a type or aspect. If it is defined over a type, then it is applicable for all objects of that type; if it is defined over an aspect, then it is applicable for all objects that have the same aspect. expose: (Optional) This attribute restricts the domain of Type. If the value is all, it is allowed to apply a PermissionSet to objects, which have a parent that satisfies the Type attribute. Otherwise, if the value is selected, the set is only applied to objects that satisfy Type attribute. All is assumed, if the attribute is undefined. PermissionGroup PermissionGroup defines its behaviour through several attributes: name: (Mandatory) Group identifier. type: (Optional) Same as in permissionSet. extends: Determines if the permissionGroup extends the definition of a previous group with the same name. If undefined, default value is false. expose: Restricts the domain of type, and if true, the permissionGroup will be applied to objects (and derivatives) that satisfy the attribute type. If it is undefined, then false is assumed. allowFullControl: If true, group has all privileges, else the privileges are to be assigned. requiresType: If false, permissionGroup can be applied to any object, otherwise only to objects that satisfies type. If undefined, the default value is true. PermissionGroup can be composed by several permissionGroups, whose sub groups will be identified by name and type. If type is omitted, the parent’s type will be used. Permission A permission is the minimal unit to represent an authorization of an action on an object. It is defined by: name: Permission identifier expose: If true, the permission can be applied to derivative objects, otherwise only to objects defined in a permissionGroup context. Default value is false requiresType: If true, a permission can only be applied to objects defined by its group context. If it is omitted, default is false A permission can require the authorization of other permissions, such permissions are identified by: name type on: Specifies where the permission is required—node, parent, or children. implies: If true, the required permission grants itself the parent’s permission. There can be only one required permission with attribute implies equal to true. If omitted, the default value is false. Inside the permission are the declarations of the permissionGroups that contain said permission. These declarations require existent permissionGroups, and can optionally specify the node types where the permission will be applied will be applied to all nodes. GlobalPermission These kinds of permissions are defined outside a permissionSet, and are applied to all nodes in the hierarchy (irrespective of its type and related aspects). This kind of permission prevails over other permission types. Roles Roles in Alfresco are a special type of permission group, concretely permissionGroups, which are defined in permissionSets applied to nodes of type content. To use these roles in the Alfresco GUI, it is necessary to create appropriate tags in the internationalization files, more specifically, the webclient.properties (this file can vary in function of language/country) and is typically located in WEB‑INF/classes/alfresco/messages Predefined Roles Alfresco defines a few basic roles in the permissionDefinitions.xml. These roles are defined in an incremental manner. First, it creates a Consumer role and then defines the rest of the roles, adding functionality to the Consumer role. Predefined roles are: Consumer: Allows read properties, content, and children of a node. Editor: Adds to consumer privileges the ability to write nodes (properties, content, and children) and execute CheckOuts in nodes with aspect lockable. Contributor: Adds to consumer privileges the possibility of adding children and execute CheckOuts in nodes with aspect lockable. Collaborator: This role has the same capabilities as Contributor and Editor. Coordinator: This role has all privileges including the possibility of taking ownership of nodes, and changing its owner. Administrator: Same as Coordinator, it is defined for backward compatibility. Default Permission Policy After a first check out of the permissionDefinitions.xml file in Alfresco 1.4, you will find five major PermissionSets. These sets establish node permissions across the Content Model hierarchy: It starts with base type, which defines basic low-level permissions. The next set defines permissions for the cmobject node types, which at this level are defined in the permissionGroups and later will be extended by roles. Content nodes have a set, which defines the available roles. In addition to these sets, the permissionDefinitions.xml file includes two other sets. One of these sets is for nodes that have the aspect ownable, and the other is for nodes that have the aspect lockable. The permissions defined in such sets allow the execution of typical specialised actions with these kinds of nodes—Check In, Check Out, Take Ownerships, Change owner, Lock, and Unlock. After PermissionSets, the configuration file declares GlobalPermissions. These permissions will be applied to all nodes, and they have priority over other permission types. At the moment, these permissions are: FullControl: Allows users who have any of these roles—ROLE_ADMINISTRATOR or ROLE_OWNER. Unlock, CheckIn and CancelCheckOut: All these allow users who have their role defined as ROLE_LOCK_OWNER New role definition example: This example is based on ideas explained in one of the Alfresco forums. The case study is the typical context, where three specialized folders are needed—Drafts, Pending approval and Published. Drafts: Stores actual working documents. Pending approval: This folder contains documents whose author(s) has/have requested approbation. Published: Stores final versions of documents. Preconditions There exist two differentiated user groups—Creators and Approvers. Creators have full access to folder Drafts and read access in Published; Approvers have full access to Pending approval and Published. Creators need to move documents from Drafts to Pending approval, but cannot see the folder files. To model this situation, we create two user groups called Creators and Approvers. Then create three spaces Drafts, Pending approval and Published. Each space will have the following configuration: Drafts: Uncheck Inherit Parent Space Permissions checkbox. Invite group Creators with role Collaborator. Pending approval: Uncheck Inherit Parent Space Permissions checkbox. Invite group Approvers with role Coordinator. Published: Uncheck Inherit Parent Space Permissions checkbox. Invite group Approvers with role Coordinator. But as you can see, with this configuration there exists a situation with the prerequisite: Creators need to move documents from Drafts to Pending approval, but cannot see the folder or files. Alfresco does not include any role that satisfies this. So, it lets you create it. Open the permissionDefinitions.xml file. First define a low level permissionGroup called CreateNodes, this group should be defined inside permissionSet with type base; in other words, available for all kinds of nodes. Also inside this set we need to declare the permissions that compose this permission group: In our case only the permission _CreateNodes. ...   <permissionSet type="sys:base" expose="all"> .../p>   <permissionGroup name="CreateNodes" expose="true"   allowFullControl="false"/> ...   <permission name="_CreateChildren" expose="false">     <grantedToGroup permissionGroup="CreateChildren"/>     <grantedToGroup permissionGroup="CreateNodes"/> <!-- New -->   </permission> ...   <permissionSet/> Then we need to define a role called Writer (remember, in set with type content), this role extends the behavior of a permission role declared in the set with type cmobject. The permissionGroup, Writer will include previously defined CreatedNode. ...   <permissionSet type="cm:cmobject" expose="selected"> ...     <permissionGroup name="Writer" allowFullControl="false"                                                        expose="true">       <includePermissionGroup type="sys:base"                                       permissionGroup="CreateNodes"/>     </permissionGroup> ...     <permissionSet/>   <permissionSet type="cm:content" expose="selected"> ...     <permissionGroup name="Writer" extends="true" expose="true"/> ... With these additions, we have created a new role called Writer that will solve our little situation. To be allowed to use it in the Alfresco GUI we need only to add a properly internationalization tag in webclient.properties: Writer=Writer role [...] Writer= OurWriter role And now we can invite the Creators group to the Pending approval space with the Writer role. The creators will be able to move documents from Drafts to Pending approval, but they will not be able to read the folder. The last operation is to add a rule called Request approval in the space Drafts that moves documents from Drafts to the space Pending approval. This is a trivial example for homework where you can try to add rules  in spaces with simple workflows to formalize the process  of  approbations and rejections.
Read more
  • 0
  • 0
  • 2334
Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime
article-image-increase-website-traffic-free
Packt
19 Mar 2010
5 min read
Save for later

Increase Website Traffic for FREE

Packt
19 Mar 2010
5 min read
Increase Website Traffic for FREE There are many techniques to getting more visitors to your website or blog. Here are a few of the better ways of getting more visitors to your website. Oh, and they're all free and you should be able to implement most in just a few minutes. Firstly, some things to keep in mind as you read these tips and tricks for getting more, free, website visitors... Google looks at your website and tries to think how a human would think.If a real person would rate your website highly, then so will Google. Google reads the words on your website.Phrases that you want to get found with should at least appear somewhere on your website. A real person would rank more highly a website with lots of links to it. If lots of other people link to the site then it must be popular.Google ‘thinks’ in exactly the same way using a technique called Page Rank or PR. More on this later. Content that changes is more interesting for repeat visitors,and Google rates more highly websites that change frequently for this exact reason. OK, with these key ideas in mind, lets move on to sending more people to your website. Who knows, the increase in website traffic may increase inquiries, orders and profit! Change your writing style As an example, take the last sentence from the previous paragraph. It used to read like this... OK, with these key ideas in mind, lets move on... This sentence would be OK in the real world, but it contains no words of any importance or relevance to our topic. The sentence was edited to contain pertinent words relating to increasing website traffic and now reads like this... OK, with these key ideas in mind, lets move on to sending more people to your website. Who knows, the increase in website traffic may increase inquiries, orders and profit! Look at every sentence on your website. Does it stand up on its own? Cut out the clutter and add key words and phrases. If you sell cars, avoid impotent phrases like "Customer Service to Rely On" and use phrases such as "Discount Car Dealership, Midlands UK". Potential visitors searching on Google won't be searching for "customer service", but they will be searching for "car dealership, midlands". Another small tip relating to your writing style is to use all derivatives of words. Take for example the car dealership. Visitors searching Google might type "dealership" or they might type "dealer". Try to use both in your text to appear in as many search results as possible.Get Inbound Links Links to your website from others offer two great benefits. Visitors to the other sites might see the link to your site and pay your site a visit. Your website Page Rank will be increased as your site now looks more popular. One of my favourite websites for blagging a free link from is www.pagemost.com. Fill in the small form on the home page and they build a page for you based on your location (give a false postcode if you're not location based). This free page is built to do well on search engines and includes a link back to your website. www.pagemost.com has a Page Rank of 5 at the time of writing, which is well worth getting a link from. To get your free page found, www.pagemost.com do recommend that you link to it from your own page, otherwise the search engines won't know it exists. On this note it's worth mentioning that although you want to get as many inbound links as you can, you should also avoid adding too many outbound links. Ebay How can Ebay help increase traffic to your website? Ebay is a very popular website and links from it to your own website will make your site look more popular. By ensuring that you always have auctions on the go at Ebay, you will always have links to your own website. It doesn't matter what you are selling as long as you remember to add links to your own website from each auction. Wikipedia It's not relevant to all websites, but why not give your website a mention and a link in Wikipedia. Most pages in Wikipedia have links to external sites, so why not add yours! If you are blatantly spamming then be prepared to be removed straight away, so make sure your website is related to the topic in question. Home Page Re-write a portion of your home page every month. Adding news items is a great way to force you to do this and gives you a reason to change the page monthly. And don't forget, a website with out of date news items looks as though the company has gone bust, so once you start this technique for generating website traffic it is most definitely an on-going process. Conclusion Re-write your website content or get somebody to do this for you. Include good words and phrases and cut out the dross! Get links to your site from sites like www.pagemost.com Get some auctions underway on Ebay See if any pages in Wikipedia or similar will handle a link to your site  
Read more
  • 0
  • 0
  • 2006

article-image-cms-made-simple-16-getting-started-e-commerce-website
Packt
19 Mar 2010
10 min read
Save for later

CMS Made Simple 1.6: Getting Started with an E-commerce Website

Packt
19 Mar 2010
10 min read
With the Products module, you can manage: Products Product attributes that will have an impact on the price (like size or color) Categories Product hierarchy Custom fields This module is the basis for all other modules that you will use later on. After all, you cannot start a shop if you do not have any place to store the products. Install the Products module with the Module Manager. Pay attention to the Dependencies section of the module before installing it. There are two (CGExtensions and CGSimpleSmarty) modules that provide convenience APIs, reusable forms, and Smarty tags for use in other modules. If you are not a programmer, you probably will not need to do anything with these modules besides adjusting some preferences if you ever need them. In the workshop described here, you just need to install them. Time for action – adding the first product After the Products module is installed, we will display it on the page Shop and add the first product to it as follows: Create a new content page Shop (Content | Pages | Add New Content). Add the Smarty tag {Products} into the field Content of the page. If you see the page in browser, it will not show anything at this time as you have not added any product to the shop so far. In the admin console of CMS Made Simple, click on Content | Product Manager. Under the Products tab, click on the Add A Product link and add your product as shown in the following screenshot: Click on Submit and see the Shop page on your website. What just happened? You have added the first product to the Products module. This product is displayed on the page with the Price and Weight (we can delete this field later on). Click the product link to see the detailed view of the product. The template looks very technical, but with some HTML, CSS, and Smarty knowledge you can change its look and feel later on. Let's concentrate on the functionality of the module first and not on the design. Add some more products in the Product Manager and see the list of products on the Shop page. Pay attention that the detailed view of every product is displayed in the same way. In the Products module, there are some fields like Price and Weight already defined. But you will need to add your own fields. Creating custom fields Usually one or more pictures of the product can be found in an online shop. However, there is no special image field where you can upload the product picture. Luckily, you can add as many custom fields as you need. In the next step, you will create a custom field, where the image of the product can be uploaded. In the admin area of the Product Manager, choose the tab Field Definitions and click on the link Add A Field. Name is a kind of technical field that is not displayed to your visitors. You should not use any special characters or spaces in the name of the field. Use only letters and numbers, no dashes, slashes, or anything else non-alphanumeric. The Prompt field is the label of the field that you will see in the admin area of the Product Manager during adding or editing products. You can use any characters in this field. The Type of the field should be Image. By selecting this type you ensure that the field is displayed as a field for file uploads in the admin area. This field will also be validated, so that only images can be uploaded here. Additionally, thumbnails for the uploaded images (small preview versions) will be created automatically after upload. Let the field be public by selecting the checkbox for Is this a public field? It means that the content of the field (the image itself) will be shown to the visitors of your shop. If you make it private, only the administrator of the website can see the field in the admin area of the module. Save the field. This field is automatically added to the detail template on the page and the editing view of the product in the admin area of the Product Manager. To test the field, open any product for editing in the admin area, and the field Product image (Prompt), and upload an image for the product using this field. Control the display of the field in the detailed view of the product on the website. The small preview version of the product is added to the section Custom Fields of the detailed view. We still do not care of how it looks like, but how it works. We will change the detailed view of the product when we are ready with all the custom fields and the product hierarchy. Image already exists When you try to upload the same image twice you will get an error saying that the image has been already uploaded. To control what images are already saved for the product and delete them, open Content | File Manager in the admin console. Find the folder Products and then the folder name product_[ID]. The ID of the product is displayed in the list of products in the admin area. Click on this folder and remove the images already uploaded. Now, you can upload the same image in the admin area of the Product Manager. Define your own fields Create as many custom fields as you need to display and manage the product. With the Type of the field you decide how the field is displayed in the admin area. The output of the field on the page can be fully customized and does not depend on the type. If you need a Product Number field, create a new custom field (Text Input) with maximum length of 12 characters and make the field public. Then edit each of your products and enter a number in this field. You can adjust the order of the fields under the Field Definitions tab. Again, this order only applies to how the admin area for the product management looks; the output on the page can be completely different. Creating a product hierarchy Next, let us create a product hierarchy. In the official shop that I am trying to reproduce here, there are four hierarchy items: Shirts (short) Shirts (long) Home & Office Mugs You should understand the difference between product categories and product items in the Product Manager module. Product categories are kind of tags for the products. It is not possible to arrange them in the hierarchy. However, you can assign one product to multiple categories if you like. In contrast to the categories, a product can belong to only one hierarchy item. That means the structure above should be implemented as a hierarchy and not as categories. One product cannot be a shirt and a mug at the same time. We will use categories later on to mark the products as: New Popular Discounted Categories will allow you to make one product both new and discounted at the same time. A hierarchy would not, as multiple assignment is not possible. In the admin area of Product Manager, click on the Product Hierarchy tab and create four hierarchy items displayed in the first list. It is your choice if you want to add any description or image to the hierarchy or leave it empty. Once the hierarchy is created, go through your already created products and assign them to the proper hierarchy item. The hierarchy can now be displayed in the sidebar navigation on the page. Open the main page template (Layout | Templates) and find the section with sidebar navigation. Add the Smarty tag for the product hierarchy shown as follows: {Products action="hierarchy"} Customizing product templates The display of the product hierarchy template is very technical. Let's customize all the templates for the module. There are three of them: Summary Templates Detail Templates Hierarchy Report Templates Let's start with  the Hierarchy Report Templates. This template defines how the hierarchy in the sidebar is displayed. In the admin area of the Product Manager, click on the Hierarchy Report Templates tab and find the list of existing templates for the hierarchy. The template Sample is the one that is used by default. You can customize this template or create your own by clicking on the New Template link. I choose the second way. It is generally advisable not to change sample templates, but create your own and set them as default. This way you can delete anything from the custom template and use the Sample template for reference if you need parts removed from the custom template. For the template name, I chose My Shop. However, you can use any name you wish. In the Template Text field, the sample template code is already suggested. Leave this code as it is and submit the new template. Now you see two templates in the list. Make the template My Shop the default one by clicking on the red cross in the Default column. Let's see what we have in the template and what we actually need. Open the new template for editing: Smarty variable Description {$hierarchy_item.name} The name of the hierarchy item {$hierarchy_item.id} The ID of the hierarchy item {$upurl} The URL to the parent hierarchy item. Only applicable if there are more than one hierarchy level. {$mod} The object containing all the information about the module Products. In the template the object is used to get translations: {$mod->Lang('parent')} returns the translation for the key parent from the translation file. You can replace this variable with your custom text if your website is monolingual and the language of the website will never be changed. {$parent} This array supposes to hold the information about the parent item. However, it is not assigned in the current version of the module and cannot be used. {$child_nodes} The array that contains information about all child hierarchy items. The information from this array: {$child_nodes.id} - ID of the hierarchy item {$child_nodes.name} - name of the hierarchy item {$child_nodes.description} - description of the hierarchy item {$child_nodes.parent_id} - ID of the parent hierarchy item {$child_nodes. image } - the name of the image file for the hierarchy item {$child_nodes. thumbnail} - the name of the thumbnail file for the hierarchy item {$child_nodes. long_name} - the full name of the hierarchy item (including the names of all parents) {$child_nodes. extra1} - the value saved in the Extra Field 1 {$child_nodes. extra2} - the value saved in the Extra Field 2 {$child_nodes. downurl} - the URL for this hierarchy item {$hierarchy_image_location} Path to the folder where images for the product are saved. {$hierarchy_item} An array that contains the id of the actual item hierarchy.
Read more
  • 0
  • 0
  • 2574

article-image-cms-made-simple-16-orders-and-payments-e-commerce-website
Packt
18 Mar 2010
13 min read
Save for later

CMS Made Simple 1.6: Orders and Payments in an E-commerce Website

Packt
18 Mar 2010
13 min read
Module Cart This  module will add simple cart functionality to the Products module. Once installed, the Cart module will be automatically displayed in the detailed view of the product. The visitor of the website will then be able to put one or more products in the basket along with the desired quantity. There are other modules that you can use instead of the Cart module, like GiftBaskets. For our example Shop, it is enough to use the simple functionality of the Cart module. Install the module Cart from the list of available modules in the Module Manager. The admin area of this module will be added to Extensions | Cart in the admin console of CMS Made Simple. Time for action – connecting products and cart If you now look at your Shop page and open a detailed view of any product, you will discover that there is still no cart functionality in it. The reason for it is that the Products module does not know that the Cart module has been installed and is ready for use. Let's connect two modules. Open the admin area of the Products module (Content | Product Manager). Click on the Preferences tab. Select the Cart module from the field Cart Module. Click on Submit and open detailed view of any product. You should see the but on Add to My Cart in the detailed view of the product. If the product has some attributes additionally to the quantity field, then the attributes are displayed in a drop-down field besides it. What just happened? You have told the Products module what module has to be used for cart functionality. Test it and add some products to the cart right now. The products will be added, but there is no possibility to display the content of the cart for the visitor yet. Create a new content page called Cart and add the following Smarty tag as the content of the page: {Cart action="viewcart"} Save the page, then open the admin area for the Cart module (Extensions | Cart) and switch to the Preferences tab. Select the newly created page in the list of pages, so that the visitor is automatically redirected to the page after he has added the product to it. There are four templates that you can customize for the module: Template   Description   AddToCart This template controls how the quantity field, the button Add To My Cart (see the preceding screenshot) and optionally product attributes with price adjustment look like. MyCart This template is used to display the cart status. It is displayed at the place where the Smarty tag {Cart action="mycart"} is placed. It shows the number of items currently saved in the cart and the link to the cart page. Viewcart This template is used for extended display of all products saved in the cart. It shows all products with their quantities and prices and the total order price. Additionally it offers the possibility to start the checkout order process if the module Orders is installed. Product Summary This template is used to format the output used for each product summary in the Viewcart template. It allows customizing the product label based on the attributes, product name, and price. The Smarty tag {Cart action="mycart"} can be added to the navigation of the website, like the link to the Basket in the official shop (http://www.cafepress.co.uk/cmsmadesimple) we are trying to reproduce. It would appear as shown in the following screenshot: There is nothing else you should know about the Cart module. The next step will be to integrate the checkout process. Module Orders This module is designed for processing orders from the cart. This module handles billing and shipping addresses from the customer and either uses an external payment gateway (such as PayPal) to handle the payment process or performs manual e-mail-based invoicing. This module can also optionally collect credit card information and store it in the database for later offline processing. Even if the module offers the possibility, never collect credit card information in a low security shared hosting environment! The Orders module keeps track of all orders, and allows for the specification of items like tracking numbers and confirmation on numbers and sending e-mails to the customers related to a particular order. The functionality of the module can be extended with even more modules that allow configuring different taxes, shipping costs, and promotion actions (like discount or promotion coupons). This module has a lot of dependencies: CGExtensions FrontEndUsers Products CGSimpleSmarty CMSMailer CGPaymentGatewayBase From this list of dependencies, you can learn that it is based on the functionality of the module FrontEndUsers. This means that your website's customers must register before they can start the payment process on your online store. There is no possibility to turn off this registration process and it is required for the checkout step. Install all modules listed in the preceding dependencies list, then install the Orders module. Time for action – adding the checkout step To enable the checkout process provided by the Orders module follow these steps: Create a new content page (Content | Pages | Add New Content) and name it Checkout. Add the following Smarty tag to the Content field of the Checkout page: {Orders} Save and view the page in the browser. This page will display either the billing form if the user is logged in or the warning message if the user is not logged in or does not belong to special user group. To connect the Cart module with the new Checkout page, in the admin console click on Extensions | Cart. Select the tab Viewcart Form Templates and click on the Sample template (or your own template, if you have created one). At the very end of the template in the Template Text field, add the following line of code: {cms_selflink page="checkout"} The parameter page should contain the page alias of the page where the Smarty tag {Orders} has been added to the content. Open your shop and add one or more products to the cart,find a link to the page Checkout at the very bottom of the screen. What just happened? You have connected the module Cart with the module Orders by placing a link from the cart view to the checkout process. To test the link, add some products to the cart and click the Checkout link at the bot  om of the cart view. If you are not logged in, you will see the following message: The user is not logged in (or not a member of the required group) This message can be found in the template of the Orders module. But first, let's see an overview of the templates delivered with this module. In the admin console, click on Content | Order Manager and find the Templates link above the list of orders: Template name Template description Billing Form This template controls the first step in the order processing. It displays the form where the customer can enter billing address and one or more shipping addresses. Payment Form This template controls the second step in the order processing and is used to display the payment form for manual e-mail based checkout process. You will need this template if you do not use any payment services like PayPal, EMoney, EWay, or Authorize.net. Confirm Order This template controls the third step in the order processing and is used to display any information the customer entered in the first and optionally second step, so that the customer can confirm the shipping and invoice addresses or go back and correct them. Invoice This template is used in the admin area of the module Orders to print out the invoice or to send it via e-mail to the customer. Gateway Complete This template is used to display the status message after the payment has been made with any 3rd party service like PayPal, EMoney, EWay, or Authorize.net. User Email This template is used to customize the e-mail with order confirmation sent to the customer when the new order has been submitted. Admin Email This template controls the layout and content of the e-mail that is sent to the authorized administrator of the store when a new order is submitted. Message There is no sample template for the messages. Here you can define your custom e-mail notifications that can be manually sent to the customers from the admin area of the module. An example for such message can be an e-mail notification that is sent when the order is shipped. Now, we know where to start and how to proceed with customizing of the templates according to our requirements and payment configurations. Let's give the customer the possibility to register with or login to the website to be able to complete the checkout process. Integrating the login screen The message that indicates that the customer is not logged in is saved in the template Billing Form (the first step in the checkout process). The user is not logged in (or not a member of the required group). This is not very user friendly. Whether the user is registered or not we should give him a possibility to log in or to register on this page as shown in the following screenshot: The login form for registered customers can be displayed with the module FrontEndUsers. In the admin area of the Orders module, click on the Templates link and create a new template with the name My Shop on the tab. Scroll down to the very bottom of the suggested template text and the last ELSE condition: ... {else} {* user is not logged in, gotta make him *} <h3 style="color: red;">{$Orders >Lang('error_notloggedin')}</h3><br/> {/if} This is the place where the message that the user is not logged in is shown. Replace this section with the login screen of the module FrontEndUsers, as shown in the following code snippet: ... {else} <h1>Already registered?</h1> {FrontEndUsers} {/if} Save the template and do not forget to set it as Default to see changes on the website. Registered customers can now log into start the checkout process. But, what about customers who do not have an account? They should be able to register themselves with our website. As it gets a bit complicated I have created the following flowchart: The billing form checks if the visitor is logged in or not. If yes, he can fill in the billing information; if not, the login form of the FrontEndUsers module (step 3) is displayed. The steps 4 and 5 in the workflow should assist new customers by allowing them to register. These steps can be accomplished with the SelfRegistration module. Read the next section to see how the module can be configured. Before you continue be sure that: The CMSMailer module is configured and is able to send out messages There is a user property of type Email Address in the module FrontEndUsers (Users & Groups | Frontend User Management, tab User Properties). There is a user group that has the above user properties associated as Required (Users & Groups | Frontend User Management, tab Groups). Integrating customer registration This module is designed to allow visitors of the website to register themselves. It optionally sends a confirmation e-mail with an activation link that must be clicked before the registration is complete. Once the registration is complete, a user account is created in the module FrontEndUsers. Install the SelfRegistration module from the list of available modules in the Module Manager. For the registration page, create a new content page Register and add the following Smarty tag into the content of the page: {SelfRegistration group="Customers"} Pay attention to the part in bold in the above code. The value of the parameter group should exactly reflect the name of user group in the module FrontEndUsers (Users & Groups | Frontend User Management, tab Groups). Open the Register page of your website and sign in yourself as a new customer with the SelfRegistration module to see how the module works by default. There are some preferences in the module that can make the registration process user friendly. In the admin area of the Self Registration module (Users & Groups | Self Registration Module), click on the Preferences tab. The SelfRegistration module offers registration with an e-mail verification step or optionally single-step registration without any confirmation. If you do not need the e-mail verificafion, you should deselect the option Require the user to confirm registraion via email on the Preferences tab of the module. The three settings considering the final message work different depending on what registration method you have chosen. Setting With verification Without verification Don't display the final message after registration Prevents the registration form to be replaced by the confirmation message after the form is submitted. Prevents the registration form to be replaced by the final message after the form is submitted. PageID/Alias to redirect to after registration is complete N/A Redirects to the given page, but replaces the whole content of the page with the final message. PageID/Alias to redirect to after verification step is complete Redirects to the given page, but replaces the whole content of the page with the final message. N/A According to the workflow, let's add a link to the registration page for the new customers (step 4). In the billing template of the Orders module, open the template for the Billing Form again, scroll down and add a link to the registration page for the new customers as shown in the following code snippet: ... {else} <h1>Already registered?</h1> {FrontEndUsers} <h1>New Customer?</h1> {cms_selflink page="register"} {/if} Pay attention to the parameter page. It should contain the alias of the page where the registration form is displayed. Customize the Registration Template 1 of the SelfRegistration module that displays the registration form. Generally, there are two templates. The first one is for the registration form and the second one (Post Registration Template) contains the message informing the customer that his registration should be confirmed through a link sent to his e-mail address. Other templates that you can customize are as shown in the following table: Templates   Description   Registration Template 2 This template contains the form where the username, verification code and password will be added to complete registration. Confirmation Email Contains subject of the verification e-mail, the plain text and the HTML version of the e-mail sent out after the customer has registered. Final Message The message is shown to customer after the registration process is completed. To build the workflow suggested above (step 5) add link to the billing form in this template, so that the user can carry on with the checkout process. It is also advisable to tick the option Login user after registration, so that the login step can be skipped after registration. Lost Email This template contains a form for the customers that have registered but did not get verification e-mail. This template is shown at the place where the Smarty tag {SelfRegistration mode="sendmoremail"} is shown.
Read more
  • 0
  • 0
  • 3952

article-image-using-moodle-integrate-foreign-language-course-secondary-school
Guest Contributor
18 Mar 2010
11 min read
Save for later

Using Moodle to integrate a Foreign Language Course in Secondary School

Guest Contributor
18 Mar 2010
11 min read
This article is written by Mariella Proietta. Introduction: technology and the learning process Researchers and practitioners, both agree on the essential role played by technology in the learning process. Yet the discussion on the changes brought about by the adoption of ICT is still controversial. An emerging topic is the importance of technology in motivating students. Academic motivation is a critical need to address, especially in high school education, since motivational features change and can significantly influence the engagement, learning, achievement, and future aspirations and intentions of students (Deci and Ryan 1985; Hardré and Reeve 2003; Pintrich and Schunk 1996). Motivation is a result of interaction between external and internal factors. It depends on individual differences, influence of outside experiences, and from interactions with teachers and peers in school. Different studies have shown the use of technological tools to increase motivation and Computer Assisted Learning (CAL) has been encouraged and developed in every field. The use of Computer Assisted Language Learning (CALL) has produced a great deal of literature from perspectives such as cognitive psychology, constructivism, psycholinguistics and has undertaken different phases from behaviouristic to integrative or integrated. Bax (2003) talks about approaches from restricted CALL, open CALL to integrated CALL. He describes them concluding that teachers’ aim should be to attain a state of 'normalisation' in which the technology is invisible and truly integrated. The expectation that teachers would adopt ICT and change their practices in particular ways has been recently questioned by research which indicates that teachers have not changed in the ways expected and researchers try to understand why. J. Orlando(2009) explores the existing literature on the matter stating that effective practices include frequency of use for knowledge construction, using ICT to enhance teaching efficiency and to extend and transform learning teachers’ practices. She notes that there is a common assumption that teachers move along and complete a determined path of change caused by the ‘techno-centric’ expectation of immediacy of change in their practices as a result of the use of ICT. She proposes a different design considering research as an evolving process, fashioned over the course of the study. This change may produce new data. But the change with ICT is distinctive and complex mainly because ICT resource innovations are continuously and rapidly changing. A new perspective helps to understand how and why changes in teaching practices mediated by ICT occur and contribute to understand the phenomenon of ICT and the impact it is having on teaching practices. Improvement and integration of the learning process in foreign language teaching Recent studies explore the increasing role of educational activities outside the classroom in the teaching and learning of foreign languages by means of hybrid learning arrangements and the integration of e-learning with classical classroom instruction. Bärenfänger (2005) explores the studies on the subject and introduces the elements of resulting pedagogic arrangements such as online references, asynchronous web-based learning, email, online assessment and testing, mentoring and tutoring. The study includes portals, synchronous web-based learning, electronic performance support systems, simulations, knowledge management, self-paced CD-ROM based content, communities of practice, video broadcasts, virtual labs and chat rooms. The author notes that these new tools satisfy the needs of learners, improve the quality of the learning experience, decrease the time a learner needs to achieve a learning goal, improve quality of the learning content and materials, improve re-usability of the learning content and materials. Among the advantages these tools also reduce cost of program delivery, allow a more effective map learning components to objectives and reduce cost of program development. Other studies have shown that distant or blended courses do not interfere with oral proficiency and interaction. According to Blake and others ‘many teachers still harbour deep-seated doubts as to whether or not a hybrid course, much less a completely distance-learning class, could provide L2 learners with a way to reach linguistic proficiency, especially with respect to oral language skills’ (Blake et al., 2008). In their study, they show that classroom, hybrid, and distance L2 learners reach comparable levels of oral proficiency during their first year of study. The Italian context In most Italian secondary schools the language course takes place mainly in the classroom (often three hours a week) with students having the opportunity to practice the four skills in a more conventional way. Some schools offer additional hours in which students are asked to work in the school multimedia laboratory, and integrate their language abilities with ICT. The majority of Italian secondary school students have, at home, a personal computer and an easy access to the web, but most of their time is spent chatting in their mother tongue and using a social network. When they are asked to visit foreign websites, find information in English or other foreign languages, do online language practice or similar activities, only a few of them are capable to accomplish the task, while the remaining students want to do the activities at school under the supervision of the teacher. The result is that most of the time is spent doing, at schools, activities that could be easily done at home. Moreover, very few students write and speak in English to communicate, apart from the simulations during the lesson, and their listening practice is mainly with songs. The procedure planned here tries to solve these problems and aims to improve and integrate the learning process with online activities. Using the platform Moodle to integrate the textbook Second language teachers can find a help to create engaging online language learning activities using the Moodle platform in different web sites, and a recent book has been written by J. Stanford for teachers, trainers, and course planners, with little or no experience of Moodle, who want to create their own language learning activities (Stanford 2009). It offers plenty of suggestions and examples for adapting classroom activities to the virtual learning environment and the author has also created a demo site http://moodleforlanguages.co.uk). What we are trying here is slightly different: we try to use the platform Moodle to support and integrate conventional class language activities. Creating learning tasks with Moodle The tools provided by Moodle can be used to integrate any level course, provide additional work outside the class and experience cooperative learning. According to Brandl ‘as a courseware package and learning System, Moodle has great potential for supporting conventional classroom instruction, for example, to do additional work outside of class, to become the delivery System for blended (or hybrid) course formats, or even to be used as a standalone e-learning platform’ (Brandl, 2005). Moodle and its platform can thus be used to integrate the school course, inviting the students to join the modules and try the new experience. They can be asked by the teacher to attend the platform and receive credits or marks, which will contribute to the end-of-year evaluation. The result of this kind of experience may contribute to support the use of new technologies in secondary schools, and increase foreign language proficiency. Preparing the platform Teachers or instructors should first prepare the platform and its parts before starting the activities, caring that each language skill could be exploited, and then they could invite their students to join the integration course. As regards language learning, among the different features, the quiz-making function has been analysed and used by many instructors and authors. Robb states that Moodle's functions ‘allow you to make different types of quizzes. Quiz types relevant to language teaching are: Multiple choice, True/False, Numerical, Matching, Description, and Cloze. A wide range of options allows you to randomize the questions and multiple-choice items, specify a time frame for availability, choose whether the students receive feedback or not, decide if they are allowed to view the correct answers, and determine how many times they may take the quiz and how it is to be scored (first attempt, highest attempt, average of all attempts or last attempt)’ (Robb, 2004). Planning the procedure Since the intention is not to substitute the textbooks, CDs or CD ROM, but to integrate them with an e-learning environment, the following steps may be followed, to create the module or sections in the platform and provide the interaction needed: The teacher chooses some Units of the textbook (or textbooks) that can be more easily considered as Learning Objects (modular digital resources that are uniquely identified and can be used and reused to support learning. The main idea of 'learning objects' is that educational content is broken down into small chunks that can be reused in various learning environments). Some of the audio material (tracks) on CDs can be saved as audio files in a directory to be used as a resource. Short video sequences can offer dialogues corresponding to the units chosen. Many sites such as the site of the BBC http://www.bbc.co.uk/worldservice/learningenglish and other sites ( e.g. http://www.lingual.net/lingualproductitems/details.php) provide this sort of video material that can be linked or downloaded from the platform. Additional audio material should be prepared, such as listening exercises, whose solutions and answers could be sent via e-mail to the teacher for correction or recorded by the students and put in an area of the platform where other students could access for listening and discussion in a chat room. A particular section of Moodle offers the opportunity to create quizzes of different kinds. Instructors and teachers who are familiar with ‘Macromedia Flash’ or similar programs can also produce interactive web pages with exercises such as drag and drop or true or false. Otherwise, each section could have some links to web sites with plenty of exercises. The teacher has only to take care that there is a great deal of interaction and feedback. Evaluation may be done through different kinds of tests. At the end of each test a mark or score can be given to each student, and added to the general evaluation in the subject. An additional mark may be given to the frequency with which students attend the platform and the areas in which they can swap information. To illustrate the procedure we have created a module choosing some of the contents of Horizons Options pre­intermediate used in Italian secondary schools mostly in the second or third year. The first approach, after the login and the choice of course, may be with a chart similar to figure 1 that can be put in the main frame: The access to each Section can be done either independently or in sequence in the sense that Section 2 can be opened only after having done the main activities in Section 1. The ‘i’ on the right provides general information about the content of the Section. By clicking on one of the titles of the sections, e.g. Clothes and fashion you can open either a frame or a new window similar to the following (figure 2): The exercises provided are mostly interactive and they can be scored independently. A particular area of the platform may be used as a kind of forum where the students write their doubts and the teacher gives explanation. They can also be encouraged to suggest the solution to the questions asked by others. Another area may be used to chat freely in the foreign language. To avoid the unbalance between oral and written skills, particular care should be taken in using tools that allow the recording of the voice and the oral communication. Students could be asked to telephone and record their call or interview a friend and put the recording on the platform. Conclusion The ideas provided in this article are only the starting point for the acquisition of a deeper competence in the use of Moodle for language learning. The choice of the Italian context is influenced by the ongoing experimentation of Moodle in Italian secondary schools, but many suggestions can come only after having used the package and the Learning System for a long time. We should reach what Bax calls normalisation referring ‘to the stage when the technology becomes invisible, embedded in everyday practice and hence ‘normalised’. To take some commonplace examples, a wristwatch, a pen, shoes, and writing - these are all technologies which have become normalised to the extent that we hardly even recognise them as technologies’ (Bax, 2003). What is important, at the moment, is starting to explore new ways of teaching and keeping alive students' interest and motivation using their means of communication.
Read more
  • 0
  • 0
  • 3903
article-image-shipping-taxes-and-processing-orders-wordpress-29-ecommerce
Packt
18 Mar 2010
4 min read
Save for later

Shipping, Taxes, and Processing Orders with WordPress 2.9 eCommerce

Packt
18 Mar 2010
4 min read
  Locations and tax setup There's no doubt that tax law is complicated, but it's a necessity. It's far beyond the scope to discuss tax law in all countries, so be sure to do your own research regarding taxes for your own state, country, and region. For businesses located in the USA, here are a couple of links to get you started: Amazon Sales Tax Info – http://bit.ly/amazon-sales-tax State Tax Info – http://www.business.gov/finance/taxes/state.html Within the USA, most businesses charge state sales tax based on the shipping information that the customer provides. While nine times out of ten a customer's billing and shipping information are the same, the times when the billing and shipping information differ can lead to some interesting scenarios. For example, if your store is based in Kansas, a customer in Kansas who buys a product and ships it to Texas would not have to pay tax on that order at least not to the state of Kansas. On the other hand, a customer in Georgia who buys your product and ships it to Kansas would have to pay tax on the order. Again, tax law is undoubtedly complicated, so be sure to look up any laws specific to your own state. On to business—the first thing to do is to verify that your Base Country/Region is correct. You can find this under the General tab of the WP e-Commerce Plugin Settings, as seen in the following screenshot: Next, verify that the tax percentages are correct for your state or region. This is just underneath the settings for Base Country/Region. Finally, switch to the Checkout tab at the top to consider one more setting. Just, under Checkout Options there is an option to Lock Tax to Billing Country. This is shown in the following screenshot: What this option does, once selected, is lock the billing country to the shipping country. For stores in the USA, it also has the effect of locking the billing state to the shipping state. This certainly simplifies matters, but it doesn't quite solve the tax scenarios outlined earlier in this section. Shipping Options and Calculators Configuring a store's shipping options is potentially one of the most complicated tasks that new store owners face, but it doesn't have to be. Much of it depends on the type of products that you are planning to sell. The absolute simplest scenario involves selling digital downloads only, in which case you don't need to worry about shipping at all. When dealing with tangible goods, one's shipping needs grow increasingly complicated depending on the diversity of the products involved and anticipated location of the customers. For instance, selling books as well as clothing will create different shipping needs than selling only books or clothing. Also, planning to sell to customers worldwide will necessitate more complicated shipping needs than limiting one's customer base to only one or two countries. Unlike creating and modifying a product catalog, configuring shipping settings is a task that only needs to be done once. General Shipping Settings To view and modify your shipping settings, switch to the Shipping tab at the top of the Settings page, as seen in the following screenshot: Under the General Settings, you have the option to globally enable or disable shipping. If your shop is comprised of digital downloads only, then you can safely switch the Use Shipping option to No and rejoice! You no longer have to worry about any shipping confi guration. The following screenshot shows the relevant panel: Those, who do sell tangible items should leave it set to Yes, as shown above. If your store is located in the USA, add the Zipcode for the area from where you will be shipping items. This is really only necessary if you plan to use one of the external shipping calculators (UPS or USPS), but it doesn't hurt to add it anyway. If you subscribe to the third-party Shipwire order fulfillment service (www.shipwire.com), set the Shipwire option to Yes and enter your relevant login information. Shipwire is a service that collects and stores your products for you, shipping them to customers when necessary. While convenient, Shipwire comes with a cost, currently starting at $30 per month. One neat aspect of the e-Commerce plugin is that you can opt to allow for free shipping, provided that the order price is above a certain threshold. At the bottom of the general shipping options is a toggle to Enable Free Shipping Discount, as seen in the following screenshot: Enter a threshold amount of your choice, such as $50, like seen above. Any orders that customers place with a value equal to or higher than that price will automatically qualify for free shipping.
Read more
  • 0
  • 0
  • 4613

article-image-google-earth-google-maps-and-your-photos-tutorial-part-ii
Packt
17 Mar 2010
19 min read
Save for later

Google Earth, Google Maps and Your Photos: a Tutorial Part II

Packt
17 Mar 2010
19 min read
Part 2: Google Maps Section 1: Introduction to Part 2 When approaching any sufficiently high-level computing topic, it is often true that we need to be familiar with a broad range of underlying and related concepts to establish the foundation necessary to learn the new material. Virtually every technology not only borrows from, but also builds on others. Furthermore, it is often the case with programming projects that the bulk of the work comes at the beginning and involves carefully thinking through the problem, devising a solution, and building those parts of the project that we need to write before we can get to the code we want to write. In the first part of the tutorial we wrote a Perl script which allows us to generate valid KML files from collections of geotagged photos. Using our new tool, we generated a number of files containing all of the data (about our photos) that we'll use to populate our Google Maps. We also looked at the structure of KML, and covered a number of other important topics, which are key to understanding the material presented here. If you have not read part 1, do take the time at least to glance through it to confirm for yourself that you won't have trouble following along with this discussion. Now we turn our attention to Google Maps. After this short introduction we'll handle the tutorial in 3 parts. Part 1: This section discusses the document-object-model (DOM), which is a formal methodology for negotiating XML files, like the KML files we created in part 1. Part 2: Next we'll look at XHTML and the XHTML file we'll use to display our Google Map. As you'll see, the file included with the project is no more than a shell, but it does suffice to allow us to present our map. Furthermore, it affords us an opportunity to talk about integrating XHTML, Javacript, and the Google Maps API. There are a few important things we'll need to understand. Working with a simple page will help us avoid complicating the issues unnecessarily and will make it easy for you to relocate the map to a page of your own (maybe as part of a weblog for example) with a minimum amount of fuss. Part 3: Finally, we'll look at Javascript and the Google Maps API. Before we get to all of that, there are a couple of preliminary topics to talk about: XML We've already looked at XML, describing it as an open, extensible markup language. We've said that XML is a metalanguage which allows us to define other languages with specific syntactic structures and vocabularies tailored to discrete problem domains. Furthermore we've said that KML is one such XML-based language, engineered to address the problem of describing geographical data and the positioning of geographical placemarks and other features to display on a map, among other applications. XHTML We haven't yet talked about XHTML which is a reimplementation of HTML as a standard, XML-based format. HTML (Hypertext Markup Language) has served as the preeminent language for authoring documents on the World Wide Web since the web's inception in the late 1980s and early 1990s. HTML is the markup language1; which makes hypertext2; linking between documents on the web possible and defines the set of tags, i.e. elements and attributes, that indicate the structure of a document using plain-text codes included alongside the content itself. Just as the web was not the first hypertext system3, HTML was not the first markup language, though both have become extremely important. Without delving too deeply into the primordial history of markup, HTML is a descendant of SGML (Standard Generalized Markup Language) which is itself an offspring of GML (Generalized Markup Language). The Wikipedia entry for GML offers this description of the language: GML frees document creators from specific document formatting concerns such as font specification, line spacing, and page layout required by Script. SCRIPT was an early text formatting language developed by IBM, and a precursor to modern page description languages like Postscript and LaTeX, that describe the structure and appearance of documents. Not surprisingly the goal of GML is echoed in the intent of HTML, though the two are far removed from each other. Berners-Lee; considered HTML to be an application of SGML from the very beginning, but with a clear emphasis on simplicity and winnowing down much of the overhead that had always characterized formal markup languages. In the early days, the web had to struggle for acceptance. The birth of the web is a story of humble beginnings4. The significance of the web was by no means a forgone conclusion and early adoption required that the markup syntax of the web be as accessible as possible. After all, more stodgy languages already existed. The simplicity of HTML certainly contributed to the success of the web (among many other factors), but it also meant that the standard was lacking in key areas. As the web gained wider appeal there was a tendency to take advantage of the early permissiveness of the standard. Developers of mainstream web browsers exacerbated the problem significantly by tolerating noncompliant documents and encouraging the use of proprietary tags in defiance of efforts on the part of standards organizations to reign in the syntax of the language. In the short term, this was a confusing situation for everyone and led to incompatibilities and erratic behavior among an ever increasing multitude of documents on the web and the various web browsers available, which differed in their support for, and interpretation of, what were in essence emerging 'dialects' of HTML. These web browsers differed not only from one another, but also frequently from one version to the next of the same application. There was a real need to establish stability in the language. Lack of dependable syntax meant that the job of building a parser capable of adequately adhering to the standards, and at the same time accommodating various abuses of the standard, had become an exercise in futility. Unlike HTML, XHTML must strictly adhere to the XML standard, which means that any compliant XML parser can negotiate properly formatted documents with relative ease. This reliability paves the way for a more efficient and sophisticated web, resulting in not only more consistent rendering of content, but the development of software that is able to differentiate and act on content based on context, and relationships among data. This is one of the primary advantages of XML, as has already been discussed, and this is a key advantage of XHTML as well. Long term, Berners-Lee, who currently serves as the director of the World Wide Web Consortium (W3C); and a senior researcher at MIT's Computer Science and Artificial Intelligence Laboratory (CSAIL), continues to actively pursue the vision of a Semantic Web. That is, a web that can be mined as a rich repository of data by intelligent software agents, which not only present information, perform basic pattern matching, and the like, but are capable of analysing information (in a truer sense—keep this or get rid of it?). From the W3C's Semantic Web Roadmap we have this brief introduction to the concept: The Web was designed as an information space, with the goal that it should be useful not only for human-human communication, but also that machines would be able to participate and help. One of the major obstacles to this has been the fact that most information on the Web is designed for human consumption, and even if it was derived from a database with well defined meanings (in at least some terms) for its columns, that the structure of the data is not evident to a robot browsing the web. Leaving aside the artificial intelligence problem of training machines to behave like people, the Semantic Web approach instead develops languages for expressing information in a machine processable form. Whether this vision accurately predicts the future of the web remains to be seen. At the moment the Semantic Web is a veritable stew of protocols, frameworks, concepts, extensions, namespaces, vocabularies, schema, ontologies, and other components. It is the subject of much debate, virtually all of it far beyond the scope of this tutorial. But this 'brave new web' is not purely academic. The increased emphasis on standards-compliant markup has resulted in developers of web browsers and content creation tools steering their apps toward the standards. This in turn motivates authors to produce compliant documents. In fact the Strict variations of XHTML do not allow for deviation from the standards. Two immediate benefits of this work, whether or not it ultimately leads to some future web, are (1) more consistent document rendering across platforms among mainstream web browsers, (2) and the emergence of the Document Object Model (DOM). We'll look at the DOM shortly. Section 2: Object Models and the DOM An object model is a collection of objects and the typically hierarchical, often complex, relationships among them, where the most generic definition of an object is simply a 'thing'. Object models are all around us and are not limited to programming or the broader topic of computing for that matter. If, for example, you were to describe a car in terms of its object model: You might start by talking about the chassis, or base frame, and then go on to describe the body of the car, its wheels, axles, exhaust system, the drivetrain, etc.; everything that is directly attached to the frame. For each of these you could describe various attributes and elements of that object; for e.g. the body material is an attribute of the body object. The elements may in fact be other objects that collectively comprise those objects within which they are contained. The body of the car contains the engine compartment, passenger compartment, and trunk elements. The engine compartment includes the engine which is itself a collection of smaller objects. The passenger compartment can be described as the collection of front and rear compartment objects, where the front compartment object includes at least a driver side compartment with a steering wheel, instrument panel, etc. These objects have their own attributes and elements perhaps consisting of other objects each of which is an object itself, with a more specific function than the objects in which they are contained. If you've ever put together a toy model of a car you may remember seeing an exploded schematic diagram of the completed model which clearly shows all of the objects from the largest container elements to the smallest ties, screws and other fasteners that hold all of the pieces together. This is a nice way to visualize the object model of the toy car. Of course the object model I have described is only an informal example. It may be fair to dispute the model I've sketched here. As long as you have a better general understanding of what an object model is then this example has served its purpose. Object models are very common within the realms of computer technology, information technology, programming languages, and formal notation. The Document Object Model The Document Object Model (DOM); is a standard object model for describing, accessing and manipulating HTML documents and XML-based formats. The often quoted description of the DOM from the W3C's site dedicated to the specification is: The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure and style of documents. The document can be further processed and the results of that processing can be incorporated back into the presented page. Remember that XHTML is a special case of XML (i.e. it is an XML based format) and essentially no more than a formalization of HTML. Because it is an XML based format the XML DOM applies. Furthermore, because XHTML describes a single format with a number of required structural elements and only a limited collection of allowable elements and attributes, the HTML DOM has a number of unique objects and methods for acting on those objects that are not available in the more generic XML DOM. Having said that, I want to emphasize the the two are more alike than the are different. Technically we will look at the XML DOM here but nearly everything discussed is applicable to the HTML DOM as well. Though there are differences, some of which we'll encounter later in this tutorial, as an introduction it is appropriate to limit ourselves to fundamental concepts, which the two share in common. We need both. We'll rely on the XML DOM to parse the KML files we generated in part one of the tutorial to populate our Google Map, and the HTML DOM to add the map to our webpage. By the time we've completed this part of the tutorial hopefully you will appreciate just how integral the DOM is for modern web design and development, though we'll only have skimmed the surface of it. The concept of the DOM is actually quite easily understood. It will seem intuitive to anyone who has ever dealt with tree structures (from filesystem hierarchies to family trees). Even if you haven't had any experience with this sort of data structure, you should anticipate being able to pick it up quickly. Under the Document Object Model individual components of the structure are referred to as nodes. Elements, attributes and the text contained within elements are all nodes. The DOM represents an XML document as an inverted tree with a root node at the top. As far as the structure of an actual XML document is concerned, the root is the element that contains all others. In every structure all other nodes are contained within a document node. In the KML files we've generated the Document element is the root element. Every other node is a descendent of Document. We can express the reciprocal relationship by stating that Document is an ancestor of every element other than itself. Relationships among nodes of the document are described in familial terms. Direct descendants are called child nodes or simply children of the their immediate ancestor, referred to as a parent. In our KML files, is the only child of . (It would be just as correct to say that is the parent node of .) Note that there could be more than one Folder node. We could use additional folders to group Placemarks (a) by year, with one folder per year, (b) by event, with each folder dedicated to a single event, or (3) by image gallery so that each folder corresponds  to a discrete image gallery, or maybe some combination of these and other criteria. Furthermore, we can have more than one type of child node under a single parent. For example Placemark is the parent node of , , and in our files. These nodes can all be described as siblings, because they all have the same parent. Also, notice that is a child of , and a grandchild (not a child) of Placemark. We can make a couple of other useful observations about this structure: Every node other than the root has exactly one parent. Parents may have any number of children including zero, though a node without any children won't be referred to as a parent. (A node with no children is called a leaf.) Implicitly there are other familial relationships among nodes. For example, elements with parents that are siblings could be thought of as 'cousins' I suppose, but it is unusual to see these relationships named or otherwise acknowledged. There is one important subtlety. Text is always stored in a text node and never directly in some other element node. For example, the description elements in our KML files contain either plain text or html descriptions of associated Placemarks. This text is not contained directly in the description node. Instead the description node contains unseen text node which contains the descriptive text. So the text is a grandchild of the description node, and a child of a text node, which is the direct descendent of description. Make sure that you understand this before continuing. Because of the inherent structure of XML, we can unambiguously navigate a document without knowing anything else about it, except that it validates. We can move around the tree without being able to name the nodes before we begin. Starting at the root document node, we can traverse that node's children, move laterally among siblings, travel more deeply from parent to child, and then work our way back up the tree negotiating parent relationships. We haven't yet described how we move among siblings. The DOM allows us to treat siblings as a list of nodes, and take advantage of the relationships that exist among elements in any list. Specifically, we can refer to the first (firstChild) and last (lastChild) nodes to position ourselves in the list. Once we are at some location in the list, we can refer to the previous (previousSibling) and next (nextSibling) nodes to navigate among siblings. Programmatically we can use the DOM to treat siblings in a XML data structure as we would any other list. For example, we can loop through sibling nodes working on each node in turn. Keep in mind that we are using generic terminology, not referring to specific node names and we are relying only on the structure of XML which we know must be dependable if the document adheres to the standard. This will work well for our KML files, and it is certainly not limited to KML. There are primarily two techniques we can use to find and manipulate elements in our XML structure using the DOM. Node PropertiesFirstly, we can take advantage of relationships among element nodes as we have been discussing.A number of node properties, some of which have already been mentioned, allow us to move between nodes in the structure. These include: firstChild,lastChild,previousSibling,nextSibling,parentNode If we look at a fragment of KML, similar to the KML files generated in part 1 of the tutorial, starting at the Placemark element... <Placemark>     <name>value</name>     <Snippet maxLines="1">         value     </Snippet>     <description><![CDATA[         value         ]]></description>     <Point>         <coordinates>value</coordinates>     </Point> </Placemark> ...we see a number of these properties: is the firstChild of is the lastChild of The nextSibling of is The previousSibling of is is the parentNode of , , , and getElementsByTagName()Secondly, we can use the method getElementsByTagName() to find any element regardless of the document structure.For example, using the syntax... getElementsByTagName("name") ...we can retrieve all elements as a nodeList from the document which are descendants of the element we are using when we call the method. The following Javascript statement returns a list of all elements in the document and stores that list at the variable list_of_nodes. var list_of_nodes = getElementsByTagName("name"); What is a node list? A node list (NodeList) is an object representing an ordered list of nodes, where each node represents an element in the XML document. The order of the NodeList is the same as the order of the elements in the document. Elements at the top of the document appear first in the list, and the first element returned, i.e. the first position in the list, is numbered 0. Keep in mind that the list includes all <name> elements. If you look at the KML files we've generated you may notice that both <folder> and <placemark> elements contain <name&gt. We need to be aware that getElementsByTagName("name") will return all of these if we are starting at the document root. We can differentiate between these <name> elements in a number of different ways. For example we can insist that the node is a child of a Placemark node to exclude <name> elements that are the children of <folder> elements. We need to be able to refer to various properties of these nodes if we are going to act on them in any reasonable way. The XML DOM exposes several useful node properties incl: nodeName, nodeValue, and nodeType. nodeName: is (quite obviously) the name of the node. What might be less obvious is precisely how the DOM defines nodeName. The tag name is always the name of an element, e.g. 'Placemark' is the name of the <Placemark> elements The attribute name is the nodeName of an attribute, e.g. the name of the maxLines attribute of <Snippet> is 'maxLines' The name of any text node is always the string '#text'. e.g., the plain text or html that we're using as our Placemark descriptions are each contained in a text node, as has already been discussed, and the name of this text node is '#text', and not the name of the element which surrounds the value in the XML document The nodeName of the root document node is always the literal string '#document'. nodeValue: is what you might expect. The value of text nodes is text itself. So the text node of one of our Placemark elements is all of the plain-text or html within the description tags. Again, as far as the DOM is concerned the text is actually contained within a text node which is a child of a description node The value of an attribute node is simply the attribute value. e.g. maxLines="1" has a nodeValue of 1 nodeValue is not defined for the document node and all element nodes. nodeType: is certainly not something you could guess. A specific value is assigned to each of the available types (categories) of nodes. The following is an incomplete list of common node types. Element, type 1 Attribute, type 2 Text, type 3 Comment, type 8 Document, type 9 As I have already said, we will take advantage of the DOM to parse our KML files and populate our Google Maps. Many of the ideas we've seen here will seem much more concrete when we put them to use. Still, this has been a very brief look at an interesting topic that is especially important to web developers and designers. I would recommend that you pick up a book that does a good job of describing the document object model if you are planning on doing any significant amount of that kind of work. This need not be an intimidating topic, though I have found that the majority of books and articles do an inadequate job with it. If you are only interested in following along with this tutorial then this brief treatment of the DOM, the comments in the included source files, and the javascript code itself should be sufficient for you to complete the project.
Read more
  • 0
  • 0
  • 6270

article-image-multi-user-environment-mediawiki-11-sequel
Packt
12 Mar 2010
9 min read
Save for later

Multi-user Environment in MediaWiki 1.1- A Sequel

Packt
12 Mar 2010
9 min read
Time for action-reverting to previous content In our example, it appears that someone has not only changed the text for one of our pages, but someone has vandalized it as well. While one edit may be a legitimate change, as the sysop we don't want this page edited by the public, so we are going to revert to the previous page. In the case of vandalism, we have no other choice than to go back to the clean version of the page. The following screenshot shows the two changes made to the page. Following the screenshot, we will learn how to revert to the original page. Open your wiki and navigate to the page you wish to make changes to. Click on the history tab at the top of the page and you will be taken to the page history. Locate the time and date of the revision you wish to revert to. Click on the ti me and date link. In our example, we selected 21:39, 14 September 2009. We will now be taken to the page that existed on that date, and at that time. Click on the edit tab at the top of the page. You will now be taken to the editing page. As we are reverting, we don't need to make any changes. It is good practice to put something in the edit summary referring to the fact that you reverted to an earlier page. Click on Save page. A newline will be added to the page history reflecting the changes you just made as shown in the following screenshot: In the case of vandalism, it may be wise to check the contribution history of the user who vandalized the article by clicking on their IP address or user name. Clicking on their IP will often bring you directly to their user contribution page. If you are able to click on their user name, that will bring you to their user page. In the lower-left corner, there is a toolbox with a User contributions link. Click on this link. If this user is vandalizing many articles, you may need to take action. What just happened? When we noticed that our page had been edited and we did not approve of the changes, we used the page history to revert to an earlier version of the content that met our approval.In our example, we were able to revert from a legitimate change as well as an attack by a vandal. We also learned that when a vandal strikes our wiki, we may want to check their User contributions page to see what other articles they may have wreaked havoc on. More administrative tools MediaWiki has quite a few more tools that the administrator can use to help monitor a multi-user wiki. While some of these have been mentioned already in the text, such as edit summaries and minor changes, they need further explanation. Edit summaries We had a brief discussion about edit summaries in the last exercise when we were reverting to an earlier revision of a page. It is highly recommended that anyone editing a page fills in the Summary field because it makes it easier for you and your fellow contributors to understand what has been changed. It is also extremely helpful when going through the history of the page. The edit summary box can hold one line of 200 characters. If you attempt to enter more than this, only the first 200 characters will be displayed and the rest will be disregarded. In the case of a small addition to an article, it is highly recommended the full text of this addition be copied to the Summary field, giving a maximum of information with a minimum of effort. This way, readers of the summary will be unlikely to check the page itself as they already know the extent of the edit. These kinds of summaries allow users to check Recent changes, page history, and User contributions very efficiently. In addition to a summary of the change itself, the Summary field may also contain an explanation of the change. Note that if the reason for an edit is not clear, it is more likely to be reverted, especially in the case that some text is deleted. To give a longer explanation, use the talk page and make a note about it in the edit summary. After saving the page, the summary cannot be edited, so try to avoid any errors. Minor changes If you look at the previous screenshot, you will see a check box labeled This is a minor edit.Minor edits have been glossed over in this article but now, we will give them a bit more attention. When editing a page, logged-in users may mark a change to a page as a minor edit. Minor edits deal with changes such as correcting a type, changing the format of the content, or changing the presentation of the content. Minor edits usually do not involve changing the actual content of the page. By contrast, a major edit makes the article worth reviewing for anyone who watches it closely. Therefore, any change that affects the meaning of an article is not minor, even if it involves one word. The distinction between major and minor edits is significant because you may decide to ignore minor edits when viewing recent changes. Logged-in users can even set their preferences to not display such edits. No one wants to be fooled into ignoring a significant change to an article simply because it was marked minor, of course. So remember to consider the opinions of other editors when choosing this option. Users who are not logged into the wiki are not able to mark changes as minor because of the potential for vandalism. The ability to mark changes as minor is another way you can entice your visitors to register. It is always better to mark the edit as minor if you are doing the following changes: Spelling corrections Simple formatting (capitalization, bold, italics, and so on) Formatting that does not change the meaning of the page (for example, adding horizontal lines or splitting a paragraph into two where such splitting isn't contentious) Obvious factual errors (changing 1873 to 1973, where the event in question clearly took place in 1973) Fixing layout errors We have to remember the following things when we are marking an edit as minor edit: Any change to the wikitext, even if it does not affect the presentation of the page in HTML (for example, adding a space or a line break), will still be treated as a change according to the database. Marking a major change as a minor one is considered bad manners, especially if the change involves the deletion of some text. Reverting pages is not likely to be considered minor under most circumstances. W hen the status of a page is disputed, and particularly if an edit war is brewing, then it's better not to mark any edit as minor. Reverting blatant vandalism is an exception to this rule. A user's watchlist will only list the most recent change made to a page, even if that edit was minor. Therefore, a minor change will supersede a major one in the watchlist. This is because a user who keeps a watchlist is generally interested in all changes made to a page. If you are uncertain about the changes made to a page, double-check the page history. If you accidentally mark an edit as minor when it was in fact a major edit, you should make a second "dummy" edit, but make a note in the edit summary that "the previous edit was major". As a trivial edit to be made for this purpose, just opening the edit box and saving (changing nothing) will not work, neither will adding a blank space at the end of a line or a blank line at the end of the page—in these cases the edit is canceled and its summary discarded. However, you can add an extra space between two words, or can even add a line break. These changes are preserved in the wikitext and recorded as a change, although they do not change the rendered page. It may be worth communicating any disagreement about what is minor via Talk or a message to the contributor, being careful to avoid a flame war with other users. There is a gray area here, and many contributors will appreciate feedback on whether they've got it right. It is also good to remember the following terms since we are using them every now and then: Dummy edit: A dummy edit is a change in wikitext that has little or no effect on the rendered page, but saves a useful dummy edit summary. The dummy edit summary can be used for text messaging, and correcting a previous edit summary such as an accidental marking of a previous edit as "minor". Text messaging via the edit summary is a way of communicating with other editors. Text messages may be seen by dotted IP number editors who don't have a user talk page, or editors who haven't read the subject's talk page, if it exists. A dummy edit should be checked as "minor" by logged-in editors. Consider the following example: Changing the number of newlines in the edit text, such as putting a newline where no newline exists or adding one more newline to two existing newlines, has no effect on the rendered page. But changing from one newline to two newlines makes a rendered difference as it creates spacing between the contents in Mediawiki and may not be a dummy edit. Adding newlines to the end of the article will not save as a dummy edit. Dotted IP number editors are editors who are referred to by their IP address in the dotted decimal notation rather than a username, for example, 192.168.1.230. Null edit: A null edit occurs if a page save is made when the wikitext is not changed, which is useful for refreshing the cache. A null edit will not record an edit, make any entry in the page history in recent changes, and so on. The edit summary is discarded. Consider the following examples: Opening the edit window and saving. Adding newlines only to the end of the article and saving is also a null edit.
Read more
  • 0
  • 0
  • 1458
article-image-multi-user-environment-mediawiki-11
Packt
12 Mar 2010
2 min read
Save for later

Multi-user Environment in MediaWiki 1.1

Packt
12 Mar 2010
2 min read
Many organizations use MediaWiki as the platform to deliver content with no option for editing or creating. Even though these options exist, in its truest form, a wiki is a collaborative environment. This means we may have multiple users accessing the system and participating in building the wiki. The count might be more than few thousands for a given moment if the site is popular. With any platform that caters to a diverse group of people, issues are bound to arise. Contributors may make mistakes in their articles, there may be conflicts over changes made to a page, and many other issues can arise when dealing with people. Working in a multi-user environment definitely has its advantages, but as a wiki administrator, it is important to keep in mind that not all users have good intentions. As the system is open, anyone—including malicious users with bad intentions—can partake in any activity on the site. An open system can face a lot of user-related problems. The first major problem is that anyone can edit or add contents. This can be dangerous if the added content is not legal or if it is copyrighted. As the user can avoid being tracked, the site has to take the responsibility for such acts. Another major attack can be on the content itself—people with bad intentions can change content without any reason or present false information. Vandalism is also a common occurrence on such sites, and the concerns regarding false information have plagued even the most well-respected of sites—Wikipedia. In this article, we will take a detailed look at these issues and learn how we can address them.
Read more
  • 0
  • 0
  • 1686

article-image-managing-menus-joomla-15-part-2
Packt
12 Mar 2010
9 min read
Save for later

Managing Menus in Joomla! 1.5: Part 2

Packt
12 Mar 2010
9 min read
Time for action—tweak the menu position and orientation Placing a second menu in the left-hand side column makes it very prominent. You might notice that site visitors find this second menu distracting. And after all, the static links to information about SRUP aren't really that important. Why not move the menu somewhere down the page? We'll publish the SRUP links as a horizontal menu at the very bottom. By default, at the bottom of the screen there's a copyright notice. We'll start by removing this to make room for the new menu. Removing the copyright notice involves deleting a few lines of code from the template HTML. If you want to move the menu to any other screen position you can skip the first three steps: Navigate to Extensions | Template Manager. Select the rhuk_milkyway template and click on Edit HTML. In the HTML editor screen, find and select the following code: <p id="power_by"> <?php echo JText::_('Powered by') ?><a href="http://www.joomla.org">Joomla!</a>.<?php echoJText::_('Valid') ?> <a href="http://validator.w3.org/check/referer">XHTML</a> <?php echo JText::_('and') ?> <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>.</p> Press the Delete key to remove the selected code and click on Save. You can preview the frontend to check if the copyright notice has effectively disappeared. To have the About SRUP menu occupy the free position, we'll edit the menu module properties: Navigate to Extensions | Module Manager and click on the About SRUP menu module. In the Position drop-down box, select syndicate. This is the bottom most position in this template. In the Parameters section, click on Module Parameters and set the Menu Style to Legacy – Horizontal. This will make Joomla! display the links horizontally side by side in a table row. Click on Other Parameters. In the Spacer text box, enter a character to display in between the horizontal links. In this example, we'll enter two dashes. The effect is that the menu links will be displayed as follows:Who are SRUP? -- Mission Statement -- Contact Click on Apply and click on Preview. The menu has been moved to the bottom of the page: What just happened? We've just removed the copyright notice that by default appears at the bottom of the template. This creates room for a separate "About SRUP" menu. To get this menu to display at the bottom position we've changed its module position and the menu style (the links orientation) from the default values. The result is that the menu is now displayed as row of links at the bottom of the page. This makes them much less prominent. Only visitors looking for these links will really notice them. This kind of presentation is a good choice for links that don't fit the main navigation menus. In this example, we've moved links on the organization behind the site to the bottom menu. In real life, it's common to publish static links there (such as About This Site, Disclaimer, and Sitemap). Menu Manager or Module Manager?To customize a menu, you'll sometimes use the Menu Manager, and sometimes use the Module Manager. What's the difference? The Menu Manager is used for everything that has to do with the contents of the menu. Anything to do with the display of the menu module you control through the module settings. Option 3: Creating submenu items There's still room for improvement in our Main Menu. Although there are now only five links left, the way they're organized might still confuse visitors. Having a News link and a separate News Archive link, both on the same menu level, is odd. Visitors will expect a News link in a main site menu, but News Archive shouldn't really be a top-level link. Joomla! allows you to add a secondary level to a menu so let's change News Archive into a secondary link that will only display after the News link has been clicked. Time for action—create a secondary menu item Let's remove the News Archive link from the primary level in the Main Menu and show it as a sublevel link: To edit the Main Menu contents, navigate to Menus | Main Menu. Click on the title of the item you want to edit, News Archive. In the Menu Item Details section, the parent item is set to top. Change the parent item to News: Click on Save. In the list of menu items in the Menu Item Manager, the new sublevel menu item is shown indented: Click on Preview to see the output on the frontend. The Main Menu now shows four primary links. When the visitor clicks on News, a secondary link News Archive is displayed: What just happened? By assigning a parent item to a menu link you can create a submenu item. Of course, submenus aren't the only way to make secondary content visible. The main links, can point to overview pages with links to content from sections or categories. Those "secondary home pages" can make secondary menu links superfluous. However, sometimes it's better to add sublevels in the menu itself. If you have items outside of the section or category structure (such as uncategorized pages), submenus can clarify the coherence of the site. You can have main ("parent") links and secondary ("child") links. Creating split submenus When you want to use submenus on your site, you can also choose an altogether different presentation from what you've just seen. You're not limited to having submenu items shown within the main menu, as it's also possible to place main navigation links horizontally along the top of the page and display second level links in a separate menu (for example, in a vertical menu in the left-hand side column). This creates a clear visual distinction between the main menu items and their submenu items. At the same time the visitor can see that those two menus are related. The parent item can be displayed as "active" (using a different style or color) when the related submenu is displayed. An example is shown in the following screenshot. The primary link, Activities, is shown in a (horizontal) main menu bar. When this link is clicked a separate submenu shows secondary links (submenu links) to two category overview pages (Meetings and Lectures): How do you build this kind of menu system in Joomla!? In short, you create a copy of the main menu, set the original main menu to show only the top-level links, and set the copy to show only the second-level links. Joomla! will automatically display the appropriate submenu when the parent item is chosen in the top menu. We won't add a split menu system to our example site as it doesn't have the amount of content that would justify an elaborate multi-level navigation. However, feel free to experiment on your own website, as this is a very powerful technique. The following are the required steps in more detail: Suppose you have created a Main Menu with two or more links to sublevel items. Navigate to Extensions | Module Manager. Select the Main Menu module and click on Copy. The same list now contains an item called Copy of Main Menu. Open that copy and enter another title (for example, Submenu). Select Position: left. In the Module Parameters, set the Start Level to 1 and the End Level to 1. This will make the menu display only second-level menu items. Now edit the Main Menu module to show only the top-level items. Set Start Level to 0 and End Level to 0. The menu is done! The submenus now only display when the corresponding main-level link is clicked. Have a go hero—arrange menus any way you like Joomla!'s split menu capabilities allow you to design exactly the type of navigation that's appropriate for your site. You can place a row of main menu links at the top of the page and position secondary (submenu) links in the left-hand side or right-hand side column. Try to figure out what arrangement of main and secondary links fits your site best and how you can realize this in Joomla!. Here are a few suggestions (some common arrangements of site navigation) to get you going: By default, Joomla's main menu links are displayed as a vertical row in the left-hand side column. How can you achieve a horizontal row of main menu links, as shown in the first three images above? Have a look again at the Time for action - Tweak the menu position and orientation earlier in this article. It shows the easiest way to change the menu orientation in Joomla!, selecting the appropriate Menu Style in the menu module editing screen. However, there are templates that are specifically designed to support horizontal menus. These contain the appropriate module positions and module styling for a main horizontal menu (and do a much better job at this than the default Joomla template). Exploring menu module settings When creating or editing a menu module, the module details and parameters allow you to control exactly where the menu is shown and how it displays. In many cases, the default settings will do—but if you really want control over your menus, it's a good idea to explore the wide range of additional possibilities these settings provide. In the Module Manager, click on the menu name (such as Main Menu or About SRUP). The Module: [Edit] screen appears. The three main sections of the Module: [Edit] screen are Details, Menu Assignment, and Parameters.
Read more
  • 0
  • 0
  • 2117
Modal Close icon
Modal Close icon