[ic] Using dynamic components in otherwise static pages.

Jonathan Clark interchange-users@interchange.redhat.com
Tue Apr 30 12:55:01 2002


> I'm a newbie to Interchange but have lots of experience with
> other shopping
> cart systems.  Pretty much every page in our website is a different
> template.  Because of this I only want to use Interchange components where
> needed on HTML pages.  For example display the shopping cart or a shopping
> form on an otherwise static HTML page.
>
> Can anyone help me with this.  I would like to see some code where other
> people have done this.
>
> We currently use Mercantec SoftCart - I would like to mimic the use of its
> tags (<display cart> for example) with Interchange.

In the stock foundation catalogue, index.html page, second control set you
have:

[control-set]
[component]cart_tiny[/component]
[/control-set]

.. which means "in the second control-set location, put the cart_tiny
component" (actually it just means remember this setting for use later, and
allow editing of it using the ui layout editor) This puts a small cart at
the top of the left section of the page.

.. and lower down:

	@_LEFTRIGHT_TOP_@

which means "insert the component 'LEFTRIGHT_TOP' at this point in the page.
This component provides all the html from the top of the page down as far as
the start of the left collumn.

the LEFTRIGHT_TOP component is at
<catroot>/templates/foundation/regions/LEFTRIGHT_TOP, and at the bottom has:

      [include file="templates/components/[control component
search_box_small]" group=vertical][control]
      [include file="templates/components/[control component
category_vertical]" group=vertical][control]
      [include file="templates/components/[control component none]"
group=vertical][control]

which allows for three components in the vertical section of the page. These
are defined right at the top of the index.html page and so for our second
one, the [control component category_vertical] is replaced during
interpolation with "cart_tiny". (the category_vertical bit is just the
default value)

SO...

to actually answer your question.. you can use [include
file="templates/components/cart"] to display the  cart component in an
otherwise static page. I would, however alter your otherwise static pages to
use the [area] tag to get interchange to serve your pages:

<a href="index.html"> becomes <a href="[area index]">

Good luck!

Jonathan
Webmaint.


PS. Ed was right about the modularity - it is difficult to understand at
first.