How soon could the News Mod have SEO friendly URL's

General project discussion. NOT for help questions.
Post Reply
avon_g

How soon could the News Mod have SEO friendly URL's

Post by avon_g »

Guys.......

Questions in the subject again....is it allot of work?

Regards

Andy
avon_g

Re: How soon could the News Mod have SEO friendly URL's

Post by avon_g »

I dont know Vin...havnt tried it yet....its a hack and might work....but if my news gets seo'd.....then the module changes, it screws everything up........would the news mod guys use the hack in the module some how?
nivekiam

Re: How soon could the News Mod have SEO friendly URL's

Post by nivekiam »

That might be your only option right now if you want to use the news module as it's intended.  IMO, that hack is not a perfect solution and if the developer responsible for News were to update it for perfect pretty URLs that's probably not the solution they would use.  Ideally I would like to not have the article id in the URL.

From what I've seen, this is not an easy fix and would involve quite a bit of work:
http://forum.cmsmadesimple.org/index.ph ... l#msg91725

Another option which is the one I'm probably going to implement, is what is suggested here by Walkere:
http://forum.cmsmadesimple.org/index.php?topic=18095
I played with the News summary template a bit, so that now the title links straight to a content page.  This way the news articles are simple stubs for new content pages, which seemed more useful than a "Detailed" version of the news article.
Here's how Walkere did it:
http://forum.cmsmadesimple.org/index.ph ... l#msg92330
I write up the standard content page (which has the pretty url).  Then, I modified the news template and write a News article stump for it.  I added a custom field with the page id #, and use that for a cms_selflink tag in the template.  That replaces the normal link that would go to the "Detailed" viewed of the news entry.
I just did this to test it out.  Here are the steps I did.  I don't know if this is exactly how Walkere did it or if there is a more efficient way to do this, but it works.

1) Create a Field Definition, I called mine PadeId and make it Public

2) Edit your Summary Template, here are the changes I made to the default template:

[EDIT]
Original post below, struck through, there is a much easier way to do this:
http://forum.cmsmadesimple.org/index.ph ... 266.0.html

{cms_selflink page=$entry->pageid}

[{cms_selflink page=$entry->pageid text="More"}]


I added the code below:

{if isset($entry->fields)}
    {foreach from=$entry->fields item='field'}
        {if $field->name == 'PageId'}
            {eval var=$field->value assign="newsDetailPageId"}
        {/if}
    {/foreach}
{/if}



Here is the cms_selflink to link to the content:


{cms_selflink page=$newsDetailPageId}


Here is my change to the more link:


[{cms_selflink page=$newsDetailPageId text="More"}]


As far as I can tell you still might want to do this this, or something similar.

{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
   
        {if $field->type == 'file'}
          file_location}/{$field->value}"/>

Had to change the line below so the PageId field isn't displayed in the summary
        {elseif $field->name != 'PageId'}
          {$field->name}: {eval var=$field->value}
        {/if}
   
  {/foreach}
{/if}

That' it.
Last edited by nivekiam on Mon Feb 11, 2008 11:17 pm, edited 1 time in total.
Post Reply

Return to “General Discussion”