In general, if you want to make additional variables available in your
templates, the Django way is to use a context processor. Docs are here -
http://docs.djangoproject.com/en/dev/ref/templates/api/#writing-your-own-context-processors

The other option is to create a custom template tag to pull in the data.

Finally, in Satchmo, there is a signal that you can use to add a custom
context variable to the existing Satchmo context. You can read more about it
here -
http://www.satchmoproject.com/docs/dev/signals.html

Hope this helps,
Chris

On Mon, Mar 29, 2010 at 5:12 AM, Simon Lee <[email protected]> wrote:

> Hi,
>
> I am a newbie to Satchmo, trying to set up a customized store with it.
>
> Instead of the default index page which shows "Welcome to the shop'. I
> would like to display a message at the top such as "Hello, Simon Lee"
> where Simon Lee is the current login customer. If not login, just
> display "Hello."
>
> I found the two templates that are resposnsible for this page as:
>
> satchmo_store/shop/templates/base.html
> satchmo_store/shop/tempaltes/shop/index.html
>
> I copied them and put them into the templates directory inside my
> project. Using django-debug-toolbar, the local version of the
> templates in my project were loaded. To accomplish what I need, I
> tried to modify my local copy of base.html. Since the user name was
> not in the view that is responsible for fetching the index.html
> template, I cannot display the user name. To do that, should I create
> a customized satchmo_store.shop.views.home.home() with a user_name
> template variable or is there a simpler way of doing it? Can someone
> give me an example of how to do this? Thanks.
>
> Simon Lee
>
> --
> 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]<satchmo-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/satchmo-users?hl=en.
>
>

-- 
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