All Products Listing

8 posts by 2 authors in: Forums > CMS Builder
Last Post: April 5, 2008   (RSS)

Re: [jposwald] All Products Listing

By Dave - March 31, 2008

Hi Juan,

I'd try creating just 2 sections (tables) called Courses and Categories.

In "Categories" create a field for "Category Name" (and any other fields you need).

In "Courses" create a list field for "Category Num" and set the List Options to "Get options from database" and select your categories table, field num, and field for "category Name".

Then, when you edit your Course record you should have a pulldown for categories that you can select from.

Your course viewer (courseList.php or whatever you name it) will list all courses, and you can limit that by adding this on the url: courseList.php?categoryNum=2

Hope that makes sense. See if you can get that far and then we can work on the sorting. Let me know if you have any questions or need more explanation for that.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] All Products Listing

By jposwald - April 1, 2008

Dave, great, I did it.

I have 2 questions:

1) Inside the CMS when I go to Courses Menu that I've Created I put 6 ListPage Fields, but the Category Name Row shows me Numbers (I think it could be records num) instead of the name of the Courses from list field.

Can I fix it? and show the Category Name instead numbers.

I attached a Photo: (q1.gif)

2) I need that the full list CourseViewer (in this case: http://www.worldwidetrainings.net/EL_Listado.php) when a User hit "See more / Ver mas" link do not take them to $options['viewerUrl'] = 'EL_Listado_ver.php', I need to take them to specify URL depending the Course.

For ex: if a user clicks in Management's course "Ver Mas" link, take him to http://www.worldwidetrainings.net/EL_Management_ver.php?Curso_1-6/, not to: http://www.worldwidetrainings.net/EL_Listado_ver.php?Curso_1-6/

It's that possible? or you have any other idea? I want to make that because I want to show specifics images and links into each specify course URL, I do not how to make it in another way...

Thank you Dave,

Juan.

PS: if this enquiries requires a consulting hour charge, please do not hesitate to tell me.

Best Regards,
Attachments:

q1.gif 55K

Re: [jposwald] All Products Listing

By Dave - April 1, 2008

Hi Juan,

1) One limitation of the method I showed you was that it will show the category number and not name on the list page. So you can't really list it there.

One way around that is to have the list field use category name twice instead of num and name. That will work as well, but if you change your category names you'll need to go and update the courses to point to them again.

So the solution is either to not have category data on the editor list page or convert the list field to use only category name and not number.

2) There's two ways to do that. You can use an "if" statement to test on the list page like this:

<?php if ($record['category'] == 'management'): ?>
http://www.worldwidetrainings.net/EL_Management_ver.php?<?php echo $record['num'] ?>

<?php elseif ($record['category'] == 'accounting'): ?>
http://www.worldwidetrainings.net/EL_Accounting_ver.php?<?php echo $record['num'] ?>

<?php else: ?>
<a href="<?php echo $record['_link'] ?>"><?php echo $record['title'] ?></a>

<?php endif ?>


Note, make sure the fieldnames (category) and values (management, accounting, etc) match what you have on your end.

You could do it that way to link to different pages. Or if your pages aren't that different you could just have one page and use the if statements on that page to show different images depending on the category.

Hope makes sense. Let me know if you need more details.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] All Products Listing

By jposwald - April 1, 2008

Dave, great I did it. Now we pass to Sort by Date and Sort by Name thing in Viewer Pages.

Re: [jposwald] All Products Listing

By Dave - April 2, 2008

Great, so to sort by date on the list viewer we'll make it so you can change the sort order by adding ?order=date or ?order=title and so on to the url. To do that add this below $options['orderBy']:

$options['orderBy'] = '...';
if (@$FORM['order'] == 'date') {
$options['orderBy'] = 'date DESC, title';
}
else if (@$FORM['order'] == 'title') {
$options['orderBy'] = 'title';
}


Then update the fieldname and orderBy values (in red) to have whatever values you want. The first (original) orderBy is the default. Then if you link to the page with ?order=date on the end it will use the new orderBy you specify below.

How that makes sense. Let me know if you need anything else. :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] All Products Listing

By jposwald - April 4, 2008

Dave, this CMS is excelent, still needs some features, but we are sure, you are going in right way.

We are making the first e-learning site for Central America, and also will sell courses to United States, with Saba association.

I think it going to be a huge iniciative to use your CMS to this high traffic sites, we are all going to learn from it.

My programmers are testing search scripts, so I gonna let you know which one was the best to use with this CMS.

I will have some more questions for sure, but instead so, I going to advise you when the site is finished to see it.

Best Regards.

Re: [jposwald] All Products Listing

By Dave - April 5, 2008

Sounds good! :) I've created a thread for feature requests so feel free to post any ideas or suggestions you have there.

Looking forward to seeing your site. Let us know when you need more help! :)
Dave Edis - Senior Developer
interactivetools.com