Question: Menu from categories and filter by category

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

Question: Menu from categories and filter by category

Postby MersauX » Mon Jul 16, 2007 10:15 pm

Hello everyone,
I would like to ask is there a way to create a menu by listing categories that are available in Coranto? This way the category menu would be updated automatically when I add a new category in Coranto. Now, I intend to have a two-language website powered by one Coranto installation, so I will have two different sets of categories, depending on the language.

This is what I want to do. I am supposed to create a products page which will first show a list of the main categories products are in, e. g.

Code: Select all
Category 1
Category 2
Category 3
etc.


Then, every category should link to a page with the list of all products in that category.

I know this can be done by creating a template for every single products page, but is there a way (read: code) that allows me to put it all in a single template? A piece of code that recognizes which category was chosen hence displaying the list of products in that category, i. e. if Category 1 was clicked the page displays the list of products in that category. Then again every item in the list of products would link to the page with the product description.

I hope I described it well enough. Thanks in advance for your help.
MersauX
 
Posts: 10
Joined: Sun Nov 13, 2005 5:10 pm
Location: Visoko, BiH

Postby SrNupsen » Tue Jul 17, 2007 7:04 am

Several possible ways. One possible solution, put this in your style:

Code: Select all
<If: Sub: isNewCategory>
<a href="/products/lists/<Field: Category>/>
<Field: Category>
</a>
</If>


... and then you only have to build all the product lists into the correct directories (remember that the Maginot addon lets you use Coranto field in the specified path to build files in - if your categories are foo and bar, then specifying /<Field: Category>/products in the Maginot profile's output path will give you /foo/products and /bar/products - customize this the way you want)

This is merely an example ofcourse - everything in here can be changed.

N.B. You will need the IsNewValue addon, available from Parahead's Coranto Corner
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby MersauX » Tue Jul 17, 2007 9:04 am

I get it, thanks. Only one more question, isn't this going to list all categories that I have, how would I skip certain categories, for example the news category and the product categories which are for the second language?
MersauX
 
Posts: 10
Joined: Sun Nov 13, 2005 5:10 pm
Location: Visoko, BiH

Postby SrNupsen » Thu Jul 19, 2007 9:04 pm

In the profile used to generate this page, just don't select the categories you don't want included ;)
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby MersauX » Thu Jul 19, 2007 11:02 pm

Oh, stupid me. Thank you. I though it would override the profile settings and list all the categories I had.

P. S. This is the first time I'm using Maginot, so please don't get angry if I ask some questions. :)
MersauX
 
Posts: 10
Joined: Sun Nov 13, 2005 5:10 pm
Location: Visoko, BiH

Postby SrNupsen » Fri Jul 20, 2007 6:24 pm

MersauX wrote:P. S. This is the first time I'm using Maginot, so please don't get angry if I ask some questions. :)


Been there - just shoot! :)
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby MersauX » Sat Jul 21, 2007 7:31 am

As I said, it is my first time with Maginot, so I'm not an expert in any way. I have managed to arrange almost everything as I wanted. But just when I thought I was getting on well I ran into a problem.

This is my problem: I created a split profile, I split the products by category, everything is fine. But, I also want that every sliced profile page contains the links to all products inside that category.

The main categories are on the left, on the right is the first product from the category "blabla". This category also contains other products and I would like to have links to all of them above the description of the first product. The same would be on the page for the second product etc.

I tried using the isNewValue, but it only displays the name of the product on that very page. Creating a standard profile and including it into the page isn't an option, because I'm using the "on the fly" option in adding categories.

I also tried using Maginot Sliced Index, but it counts all the pages in the sliced profile (a this moment there is a total of three, two in the category blabla and one in the category test) and all three items get the same subject, the one from the article on that page.

I hope someone has an idea what to do. Thanks.

EDIT:

Well, I solved it somehow. I don't know if this is the best way. I simply created a second sliced profile and included it into the first sliced profile.
MersauX
 
Posts: 10
Joined: Sun Nov 13, 2005 5:10 pm
Location: Visoko, BiH


Return to Customization

Who is online

Users browsing this forum: No registered users and 2 guests

cron