modifying layout for category_tree

16 views
Skip to first unread message

newbie730

unread,
Oct 29, 2008, 8:57:36 PM10/29/08
to Satchmo users
In the style.css file, there are some id's and tags that can modify
the appearance of the category tree Unordered List. What I'd like to
do is the following:

Sub Categories are hidden until a root category is selected then the
sub-categories are displayed on a row beneath the root categories
list, all in a horizontal layout. The default Satchmo layout shows
the UL as a vertical hierarchy.

Any ideas on how to achieve this?

Thanks!

Chris Moffitt

unread,
Oct 29, 2008, 9:35:59 PM10/29/08
to satchm...@googlegroups.com
The quickest way might be to use some javascript (like jquery) to toggle visibility.

The other option is to look at how we do the category template tag and create a new one that only display children if the parent is selected.

-Chris

Bojan Mihelac

unread,
Oct 30, 2008, 12:05:52 PM10/30/08
to Satchmo users
you can try templatetag on
http://source.mihelac.org/2008/10/30/satchmo-categories

In top block I use:
{% categories active=category deep=0 select_parents=1 %}

and for subcategories:
{% categories active=category from_level=1 %}

hope it helps

Shankar Dhanasekaran

unread,
Oct 30, 2008, 12:09:08 PM10/30/08
to satchm...@googlegroups.com
Thank you for sharing the code. I will give it a try!

~Shakthi

Shankar Dhanasekaran

unread,
Oct 30, 2008, 2:21:36 PM10/30/08
to satchm...@googlegroups.com
Hi Bojan,
Thank you for this. But can you please explain in detail on how to use this?
I'm absolute beginner and don’t where and how to use your code.

~Shakthi

-----Original Message-----
From: satchm...@googlegroups.com [mailto:satchm...@googlegroups.com]
On Behalf Of Bojan Mihelac
Sent: 30 October 2008 21:36
To: Satchmo users
Subject: Re: modifying layout for category_tree


Bojan Mihelac

unread,
Oct 30, 2008, 4:49:15 PM10/30/08
to Satchmo users
Shakti, add this to templategs directory of (for example in mysite or
custom app and put file there).
Then {%load categories%} in templates where you want to use it
(base.html, base_product and so on) and call the tag where you want it
categories to show.

Bojan

On Oct 30, 7:21 pm, "Shankar Dhanasekaran" <newage.blog...@gmail.com>
wrote:
> Hi Bojan,
> Thank you for this. But can you please explain in detail on how to use this?
> I'm absolute beginner and don’t where and how to use your code.
>
> ~Shakthi
>
> -----Original Message-----
> From: satchm...@googlegroups.com [mailto:satchm...@googlegroups.com]
>
> On Behalf Of Bojan Mihelac
> Sent: 30 October 2008 21:36
> To: Satchmo users
> Subject: Re: modifying layout for category_tree
>
> you can try templatetag onhttp://source.mihelac.org/2008/10/30/satchmo-categories

Shankar Dhanasekaran

unread,
Oct 31, 2008, 1:07:21 AM10/31/08
to satchm...@googlegroups.com
Thank you Bojan. Please don’t mind me asking very basic questions. Where do
I find this templatetags dir? And under what name should I create this new
file that you mention. I find templatetags directory under
site-packages/satchmo/shop/templatetags but am doubtful if this is the
directory you mentioned.

Thank you once again,

MikeKJ

unread,
Oct 31, 2008, 11:45:45 AM10/31/08
to Satchmo users
May I suggest jQuery treeview

MikeKJ

unread,
Oct 31, 2008, 12:17:43 PM10/31/08
to Satchmo users
site in development that uses jQuery treeview
http://performance-sports.paston.co.uk

Bojan Mihelac

unread,
Oct 31, 2008, 3:28:06 PM10/31/08
to Satchmo users
You can create your app in your project. Do not forget to add this app
to settings INSTALLED_APPS. There you can customize Satchmo without
need to modify original code. Refer to Django documentation for help
about adding apps to a project.

On Oct 31, 6:07 am, "Shankar Dhanasekaran" <newage.blog...@gmail.com>
wrote:

Shankar Dhanasekaran

unread,
Nov 1, 2008, 8:07:11 AM11/1/08
to satchm...@googlegroups.com
Can you please share how you do the jquery category tree?
Thanks

shakthi

-----Original Message-----
From: satchm...@googlegroups.com [mailto:satchm...@googlegroups.com]
On Behalf Of MikeKJ
Sent: 31 October 2008 21:48
To: Satchmo users
Subject: Re: modifying layout for category_tree

newbie730

unread,
Nov 1, 2008, 2:47:35 PM11/1/08
to Satchmo users
I'm quite new to all of this web development - I've seen several JS
libraries out there that get recommended, including JQuery, MooTools
Yahoo JS Library ... which of these would you recommend getting
familiar with?

Also, there was a mention of using template tags or creating new
template tags for what I am attempting to do. Where can I find more
information about template tags and how to create new ones?
Reply all
Reply to author
Forward
0 new messages