You want to do this for a single product?

If not, you can also get the template from the product slug, for example:

template_dirs = [s.format(product_slug) for s in ("product/{}/", "product/")]
template, origin =
django.template.loader.find_template("product.html",
dirs=template_dirs)

that way, you'll use the template in
templates/product/<product-slug>/product.html if it exists, and
fallback to templates/product/product.html if it doesn't.

This way you can have as many "specific templates" as you want without
having to write any extra code (just the templates)

On Mon, Jun 11, 2012 at 7:14 PM, vitsin <[email protected]> wrote:
> Ah! views yes! Thanks, its so simple and obvious once some one show an
> example ...
>
>
> On Monday, June 11, 2012 8:46:13 AM UTC-4, Alkatron wrote:
>>
>> On 06/11/2012 04:33 AM, vitsin wrote:
>> > hi,
>> > what would be the way(and example please) to connect specific Custom
>> > Product to its unique template(HTML page) and view(functionality
>> > behind HTML)?
>> > Once I've defined Custom Product in Satchmo, shop refers to it by
>> > unique URL,
>> > so probably it could be done ...
>> >
>> > appreciate the help,
>> > --vs
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups "Satchmo users" group.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msg/satchmo-users/-/Sb4FGJ0dLWMJ.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to
>> > [email protected].
>> > For more options, visit this group at
>> > http://groups.google.com/group/satchmo-users?hl=en.
>>
>> You have to make a custom view...something like this
>>
>> def myget_product(request, product_slug=None, selected_options=(),
>>      default_view_tax=None):
>>      """Basic product view"""
>>
>>      if product_slug == <specific Custom Product slug>: # any condition
>> that unique identify you product
>>          template = <its unique template(HTML page)>
>>          ...
>>          ...
>>
>>      else:
>>          template = <default template>
>>      ...
>>      ...
>>      ...
>>      ...
>>      return response
>>
>>
>>
>>
>> May be there is better way, but this works.... I'm learning too
>
> --
> You received this message because you are subscribed to the Google Groups
> "Satchmo users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/satchmo-users/-/-NgPJIkEEGYJ.
>
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/satchmo-users?hl=en.



-- 
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

-- 
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en.

Reply via email to