[Konstrukt] MVC/konstrukt and REST principles in practice

14 views
Skip to first unread message

Sune

unread,
May 12, 2010, 3:48:25 PM5/12/10
to Konstrukt, la...@intraface.dk
Hi

I am working on webshop which has a number of categories and each
product can be shown in different categories.

The great thing about MVC and konstrukt is that a controller can be
implemented as a subcontroller to many controllers. E.g.:

/shop/products/yellow-football
/shop/category/toys/yellow-football
/shop/category/balls/yellow-football

This is great as it is possible very easy to create links back to the
category by just adding url('../'). Also it is easy to create good
bread crump tails.

But this does not fit to REST principles which says that every
resource should have only one unique URI. And also it does not fit to
the principles of SEO as it is not good to have duplicate content (it
would be possible to solve this by adding meta-tag to tell search
engines one unique uri to the content).

Now my customer has asked me to add a "Previous" and "Next" button
when showing a product, so that it is easy to browse through the
products in a category. This would also be very easy if with the /shop/
category/balls/yellow-football way to do it, as I would be able to
find the previous and next product by simply fetching them from the
product list, which could be obtained by $this->context->getProducts()

Does anyone have any suggestions on how to solve this problem?

/Sune

--
You received this message because you are subscribed to the Google Groups "Konstrukt" group.
To post to this group, send email to kons...@googlegroups.com.
To unsubscribe from this group, send email to konstrukt+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/konstrukt?hl=en.

Anders Ekdahl

unread,
May 12, 2010, 4:05:33 PM5/12/10
to kons...@googlegroups.com

I would say that it doesn't have to be duplicate content. The page you're displaying it on probably has some extra info on it about the category the product is in. If the page is exactly the same, it should be the same url though.

I wouldn't worry too much about SEO, just make sure you use the canonical meta tag.

Sune

unread,
May 16, 2010, 5:23:29 AM5/16/10
to Konstrukt
Hi

On May 12, 10:05 pm, Anders Ekdahl <anders.ekd...@gmail.com> wrote:
> I would say that it doesn't have to be duplicate content. The page you're
> displaying it on probably has some extra info on it about the category the
> product is in. If the page is exactly the same, it should be the same url
> though.

It is true, that the bread crump trail on the page would be different,
so the page will differ in each category.

> I wouldn't worry too much about SEO, just make sure you use the canonical
> meta tag.

The canonical meta tag would be a solution, but I wonder if there is
no way to solve this still respecting the REST principles with only
one unique URI to a ressource.
Reply all
Reply to author
Forward
0 new messages