SEO URLs Getting Odd Results

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

Re: [InHouse] SEO URLs Getting Odd Results

By Dave - February 21, 2008

For the CSS, check if they're relative links. If you make them absolute urls (starting with "/" or "http://" they should work). The issue is that because the SEO urls have slashes (/) in them it's as if those files are in a subdirectory.

So if you have an url like this:
viewer.php/my_article_title-1/

A css tag like this:
<link href="css/style.css" ... />

Would look for the css here (instead of where it should)
viewer.php/my_article_title-1/css/style.css

Adding "/" or "http://" to the beginning of the css href will fix that.

Hope that makes sense.

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

Do you have a sample url where you're trying to do this?

What is the topic field and a value you want to search for?

You can either limit the results of the list viewer by specifying search criteria in the url like this: listViewer.php?topic=sports or by hard coding it in the 'where' option like this: $options['where'] = 'topic = "sports"';

Hoe that helps, let me know if you need more details.
Dave Edis - Senior Developer
interactivetools.com

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