Multi-level Category Functions

63 posts by 17 authors in: Forums > CMS Builder
Last Post: December 19, 2011   (RSS)

By Dave - August 1, 2008

Hmm, can you email me CMS and FTP login so I can take a look (to dave@interactietools.com). Let me know if that works for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi-level Category Functions

By Djulia - August 1, 2008 - edited: August 2, 2008

My excuses, Dave.

The urls are correct, I believe that I make simply an error of comprehension.

What I obtain:

Level 1 (id =1)
/categoryList.php/Level-1-1/

Level 2 (id =3)
/categoryList.php/Level-1-Level-2-3/

Level 3 (id =2)
/categoryList.php/Level-1-Level-2-Level-3-2/

---

In fact, I sought to obtain :

/categoryList.php/Level-1-1/Level-2-3/
/categoryList.php/Level-1-1/Level-2-3/Level-3-2/



And later with of records :

/categoryList.php/SectionName1-1/SectionName2-3/recordName1-1/

I will await the final version for better understanding the use (...)

Thanks,

Djulia

By Dave - August 1, 2008

Ok I understand.

You can control which field is displayed in the url before the "id" by setting "filename fields" under: Section Editors > Viewer Urls.

The simplest solution might be to just set this to 'name' instead of 'breadcrumb'

But by default it will use 'breadcrumb' and convert non-word characters to "-" so if you have a breadcrumb of: News : Technology : Web. So it becomes: News-Technology-Web

You could create the links in whatever format you like instead of using _link. For example if you created a fieldname called filename you could have:

<a href="/path/to/viewer.php?<?php echo $categoryRecord['filename'] ?>-<?php echo $categoryRecord['num'] ?>">

To link as: viewer.php?filename-here-123

And have it display whatever you want.

Would that work for you?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi-level Category Functions

By Djulia - August 2, 2008 - edited: August 2, 2008

Hi Dave,

That can solve my problem. But, I think that it is preferable to await the use with of records in a section to have an better general view.

On that subject, I tried to bind my section "category" with another section (mySection) in order to obtain a menu :

Admin > Section Editors > Field Editor

mySection :

Field Label == Breadcrumb
Field Type == List
List Options == Get options from database (avanced)
Section Tablename == category
Use this field for option values == breadcrumb
Use this field for option labels == breadcrumb

...in mySectionList.php

<?php foreach ($mySectionRecords as $record):
if ($record['_filename'] == 'Contact' OR $record['_filename'] == 'Home') { continue; }
?>
<li><a href="<?php echo $record['breadcrumb'] ?><?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a></li>
<?php endforeach; ?>

My problem, it is that "breadcrumb" gives for example :
"News: Technology: Web" and not "News-Technology-Web".

I think that the final version will correct this problem ?
Or, your approach will be different ?

Thank you for your answer.

Djulia

By Dave - August 4, 2008

Hi Djulia,

I haven't developed a way to bind two sections together and have articles in a specific category. Right now each category maps to a single page.

To have multiple articles or records in a category and list them we'd need to figure out an url format that would work for that. It would need to have some kind of category ID, and a page number. I haven't decided on a format or written functions for that yet. That was going to be the next step.

I don't know how quickly we can do that or how complex it will be but we can try and figure out some of the details now.

A simple way would be to add the page number on the end, but this will make it hard to determine which is the page number and which is the category number. Also, if we match against "page" it's in english.

category.php?category/childcat-3/page2

Matching category "filenames" such as "News/World" is another method but if any of the category names change then all the old urls will break. That's the benefit of using the number in the url.

How would you like to see it work?
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi-level Category Functions

By sidcam - August 7, 2008

Dave-

Will this function like the Parent/Sub-Catergory function in Article Manager then? If so that's the one last major piece of AM that CMS Builder is missing. What's a best guess on when that will be released? Will we be able to take existing categories and reassign them to a parent category (or move them around) in the same fashion as AM?

Thanks, Sid

Re: [sidcam] Multi-level Category Functions

By Dave - August 11, 2008

Hi Sid,

You can currently move categories around like you can in Article Manager. The last part remaining is to have it so you can have multiple articles assigned to a category. Right now each category just represents one page.

This is possible (multiple articles per category) right now with some specific code, we just need to figure out how to make it easy. Eventually we intend to add options to the code generator for all these types of pages or sections that you might want to generate.

There's no ETA on this yet, but it's very high on our list.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi-level Category Functions

By sidcam - August 12, 2008

Thanks for the reply. I've been very impressed with the speed the software is evolving.

I'm not exactly sure how I would deploy single record sub-sections. Going to have to give that some thought.

The site I'm working on now has the basic layout of a newspaper site and the main section pages are calling 10+ multiple record tables from the DB. If I understand you right, In the future I'll be able to take an existing table and reassign it to be a sub-section without having to recreate it and manually transfer over the content in the fields, correct?

I was also trying to figure out how I set up one RSS feed for a section when the section is actually 10 seperate tables. This would appear to solve that as well.

Re: [sidcam] Multi-level Category Functions

By Dave - August 13, 2008

The goal is to eventually have it be able to do the same thing as Article Manager. So you could have an Articles menu and a Category menu and manage a large part of the site with just that.

You might be able to do a multi-section RSS feed with the multiSearch feature. You can read more about that here: http://www.interactivetools.com/iforum/gforum.cgi?post=63778

It supports pulling 2 fields, title and summary, from each table. So if that would be enough for the RSS it would work. Otherwise if you need 3+ fields we'd need to custom program it or look at other solutions.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Multi-level Category Functions

Hi Dave
Can a walkthrough of the menu system please be added to the advanced topics tutorials in the CMS Builder documentation. It would be really helpful if this was included with screen grabs. The advanced topics section is promising but it only seems to remain looking slightly like a work in progress.