SEO URLs Getting Odd Results

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

Hi again,

Situation:
One PHP file with 1 list view showing archive of Topic X and one page view which defaults to showing Record #1 of Topic X with content.

Goals:
1 - Clicking a link from the list view should reload the same page and display the selected article (replacing Record #1).
2 - The default record on the page should be the most recently published Topic X article available (but not one set for a future release date).

Issues:
1 - With $options['useSeoUrls'] = ''; all works normally.
When $options['useSeoUrls'] = '1'; things go weird. The page reloads with the correct article displayed, but all linked CSS files are ignored.

2 - Having trouble getting the most recent article of Topic X to display. Can you please point me in the right direction?

Many, many thanks are anticipated.

Jayme

Re: [Dave] SEO URLs Getting Odd Results

By InHouse - February 22, 2008 - edited: April 16, 2008

Hi there,

The CSS stuff will be fixed shortly. Thanks for the lead on that. I do everything with relative links and sometimes forget that there are other ways of doing things. [blush] This site will move to a new server for production so I'm just going to have remember to change the absolute paths.

The Topic issue: My client has a repeating pattern of Tips pages for several site areas (Nutrition, Wellness, Non-smoking, etc.). I'm trying to have all the Tips in one Section Editor where they will select which site area (Topic) their tip belongs to.

I'd like to show the most recent published article for that topic by default. Then, the user will have a list of other articles by linked headline, also from that topic. Clicking one of those headlines will replace the default article. This should all happen on one page.

This is something that we're going to have repeat several times for this site so if I can find a reliable and efficient pattern to minimize the number of Section Editors they need, then we win.

Cheers,
Jayme

Re: [InHouse] SEO URLs Getting Odd Results

By Dave - February 22, 2008

Ok, there's probably a few different ways to do it. One way would be as follows:

Have one section for tips. Have a list dropdown field for "category".

Create a seperate page for each category (eg: nutritiontips.php). They'd have almost the same content, but it will be easier to customize page headings and so on.

Have two list viewers on your page. With nutritiontips.php for example, one list viewer would list all the tip links (the menu) and the other the content for the tip.

For the menu list viewer, use these options:

$options['viewerUrl'] = 'nutritiontips.php';
$options['perPage'] = '9999';
$options['pageNum'] = '1';
$options['orderBy'] = 'date DESC';
$options['where'] = 'category = "nutrition"';


The idea is that it will list ALL the tips, sorted by date (newest first - you can sort them however you want), but only list tips in the nutrition category.

And for the content viewer, use these options:

$options['perPage'] = '1';
$options['pageNum'] = '1';
$options['orderBy'] = 'date DESC';
$options['where'] = 'category = "nutrition"';

$num = getNumberFromEndOfUrl();
if ($num) { $options['where'] .= " AND num = '$num'"; }


Where this will list the newest tip from the nutrition category -OR- the tip number specified from the nutrition category.

Would that do everything you need? Let me know if I can provide more details.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] SEO URLs Getting Odd Results

So glad to have this validation Dave. Thanks to your help and a few other threads I've done pretty much as you described.

Two variations on a theme:
http://www.cinderblaze.com/mlhu/nutritiontips.php
1 tip at a time with a list of past tips

http://www.cinderblaze.com/mlhu/news.php
Many posts with an anchor list. The next trick there will be to see what happens when we roll to the next page... My problem to solve.

Best wishes,
Jayme

Re: [InHouse] SEO URLs Getting Odd Results

By Dave - February 25, 2008

Looking good, nice work! :)
Dave Edis - Senior Developer
interactivetools.com