Go to the first, previous, next, last section, table of contents.


Overriding a template (urlcatalog)

We have modified the cedit.html template and now we would like Catalog to use it instead of the default template. The simplest method would be to create a file named cedit.html in the cgi-bin/admin directory. The default templates used by Catalog are included in the code of the application, therefore you will not find a cedit.html file anywhere. You will have to create it, copying it from the example or from this documentation. When the Catalog cgi-bin executes, it looks for templates in it's current working directory which is the cgi-bin directory, at least if you're using Apache.

This method is not suitable for us because we want (for the sake of the demonstration) to keep the default cedit.html and add a new one that would be activated only if we ask for it. This is achieved very simply by the use of the style cgi-bin parameter and the templates.conf configuration file.

What happens if you call the cgi-bin with an additional argument style=urlcatalog (you will see that the link Edit URL catalog in the example HTML entry point has this parameter) ? When the cgi-bin looks for a specific template (cedit.html in our case), it first searches the templates.conf file for a renaming instruction. For instance, in the template.conf file of the example (CGIDIR/admin/templates.conf) you can see these lines:

	#
	# Catalog customization
	#
        urlcatalog
                #       
                # Catalog editing 
                #
                cedit.html = urlcatalog_cedit.html
                #       
                # Search results
                #
                csearch.html = urlcatalog_csearch.html
        end

This must be understood as : if the style is urlcatalog then use urlcatalog_cedit.html template instead of the default cedit.html. We should therefore create a urlcatalog_cedit.html file and copy the modified template HTML code in it.

In short, the modified cedit.html template is put in the urlcatalog_cedit.html file and cedit.html is mapped to urlcatalog_cedit.html for the urlcatalog style in the templates.conf file.

We have covered all the actions necessary to customize the administration interface of urlcatalog as shown in the example. We will now explain how to customize the user view of the catalog.


Go to the first, previous, next, last section, table of contents.