Coding dilemma setting up CMS pages

6 posts by 2 authors in: Forums > CMS Builder
Last Post: May 15, 2008   (RSS)

By Izadorra - May 10, 2008

My client wants a her writing page to have summaries of her articles which link to her full article pages and she wants listed by category with the ability to add more categories later.

I already have the site pretty much built so when she gave me this request with a list of categories my brain went blank as to how I can accomplish this.

Since I already have her writing page set up isn't there a way to add a field "Categories" that would pull up the summaries of those categories somehow. Geez, I know this program was designed to do this somehow without having to build separate pages for each category she wants.

The site is still a work in progress but here it is for anyone that can give me an idea about how to go about this.

http://nancycarleton.com/cmsAdmin/hl_homePage.php

Any help would be greatly appreciated.
[shocked]

Re: [Izadorra] Coding dilemma setting up CMS pages

By Dave - May 10, 2008

Hi Izadorra,

How many categories are you starting with, what are they, and are they flat (one-level) or subcategories (categories under categories)? Assuming they're one level deep, you can do it like this:

Create a new section for "Categories" with fields for "Category Name" and "Category Summary". You'll be able to automatically create a category list page for this section just like you can for other sections.

Then in the Writings section add a field called "categoryNum". Set it to field type "List", then set the "List Options" pulldown to "Get options from database (advanced)". Then select your category table, the "category num" field for the value, and the category name field for the label.

End result, you should have a pulldown of category names in the Writing section that is pulled from the category section. I hope this all making sense, still. :)

Then you can filter the results on the writing page by linking to it like this: writingList.php?categoryNum=1

Give it a try, take it one step at a time and let me know how far you get. If you have problems I'm here to help.

Let me know how it goes or if you need more detail or explanation.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Coding dilemma setting up CMS pages

By Izadorra - May 14, 2008

Thank you for your help Dave. I have gotten as far as the writingPage. I created the new section and I managed to get the drop down menu from the categories section into the writingPage but now I think I need a little help with this part;

writingList.php?categoryNum=1

I'm not sure how or where I need to put this part. I want to call a summary from each category to appear on the writingPage with the links going to the full story. Maybe a little example would help.

Re: [Izadorra] Coding dilemma setting up CMS pages

By Dave - May 14, 2008

Hi Izadorra,

Can you post an url if possible?

If you've selected some categories for some of the articles you should be able to add this at the end of the article list url to _only_ show articles from that category. Like this:

writingList.php?categoryNum=3

Where 3 is whatever the category number is that you want to see articles for.

Next, if that's working you can create a category list page that lists all your category names and summaries. One of the fields on this page will be the category num and look something like this: <?php echo $categoryRecord['num']; ?> Note that yours may have a different name besides $categoryRecord, use the name you already have in there.

Using that category 'num' field you create a link to your article page like this:

<a href="writingList?categoryNum=<?php echo $categoryRecord['num']; ?>">Writings from this category</a>

Let me know if that makes sense and if I'm understanding correctly what you want to do.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Coding dilemma setting up CMS pages

By Izadorra - May 15, 2008 - edited: May 15, 2008

Ok Dave, I know I'm close. Not sure what I'm doing wrong.

http://nancycarleton.com/cmsAdmin/writingList.php

This page should show links to each category and then a link that goes to a list of story summaries from only that category. Each of the summaries would then link to the full story.

Thanks for you help [:)]

Re: [Izadorra] Coding dilemma setting up CMS pages

By Dave - May 15, 2008 - edited: May 15, 2008

Is there a field in the writing section called "categoryNum"?

If you want to email me login info for CMS and FTP to dave@interactivetools.com I could have a look and let you know (email, don't post login info to forum).
Dave Edis - Senior Developer
interactivetools.com