Page 1 of 1

custom news urls in cms 1.9.1

Posted: Wed Dec 01, 2010 7:42 pm
by markS
Hello,

I'm trying to take advantage of the new custom urls available in the News module.  The news system works perfectly if I don't specify a custom URL, but whenever I specify one all I ever get is the 404 error page I've setup.

I've supplied a default news detail page as per the 'detail view settings' of the news option tab:

"This preference is used to determine a page (and therefore a template) to use to view detail pages. Individualized News Detail URLS will not work if this parameter is not set to a valid page. Additionally, if this preference is set, and no detailpage parameter is provided on the news tag, then this value will be used for detail links"

I've got mod_rewrite setup properly(the config works for all my other cms based sites).  Could there be additional rewrite rules required?

Turning on debug gives me a couple of relevant queries when I try and view an article:

Code: Select all

SELECT news_id,news_url FROM cms_module_news WHERE status = 'published' AND news_url != '' AND ( IFNULL(start_time, '1970-01-01 00:00:01')  < NOW()) AND (( IFNULL(end_time, '1970-01-01 00:00:01')  = '1970-01-01 00:00:01') OR (end_time > NOW())) ORDER BY news_date DESC
The above query returns the two test news articles with custom urls.

Code: Select all

SELECT * FROM cms_content WHERE content_alias = 'brand-tone-of-voice' AND active = 1
This is the next query, the cms then seems to try and find the alias 'brand-tone-of-voice', which is the news article url from cms_content and then fails, the rest of the code seems concerned with showing the 404 page.

If anyone has this successfully working or can point me in the right direction, I'd be very grateful.

Thanks,

Mark.

Re: custom news urls in cms 1.9.1

Posted: Wed Dec 01, 2010 8:43 pm
by RonnyK
and the page with the alias "brand-tone-of-voice" is marked as ACTIVE in listcontent?

Ronny

Re: custom news urls in cms 1.9.1

Posted: Wed Dec 01, 2010 9:29 pm
by markS
Hello,

Thanks for getting back to me. 

I think that might be the point.  There isn't a page by that name, that's the custom url of the news story.  The page alias of the default news detail page is 'our-views'.

Could it be picking up the wrong variable somewhere?

Regards,
          Mark.

Re: custom news urls in cms 1.9.1

Posted: Thu Dec 02, 2010 6:44 am
by RonnyK
When using News with the URL logic, make sure that the settings-tab of News is having the specified detailpage selected in the dropdown.

When you have selected a page there, that isnt active, then it will show the errorpage instead, where its content is replaced by the news-content.

Ronny

Re: custom news urls in cms 1.9.1

Posted: Thu Dec 02, 2010 10:07 am
by markS
Hello,

Thanks for getting back to me again.

Yes, that was one of the first things I checked. The default news detail page is properly set in the news options.  That page is active and works.

I have two articles with custom urls specified and they don't work properly, the system gives me the 404 error page. 
I have other articles in there without a custom url and they work perfectly.  If I remove the custom url from an article that doesn't work, it then will be found.

Like I said before, from the debug it appears that the system is looking for my custom news url as the page, it's like the wrong variable has been passed to one of the routines.

Obviously the temporary solution is not to use the custom urls, but they looked so useful I thought I'd try them out!

I'd love to know if this is a general bug or something specific to my setup.  For the record, this is a new site, originally installed with 1.9 and then upgraded to 1.9.1, all modules are the latest available versions. News is 2.11

I'm happy to do a bit more digging and debugging if you can suggest the best place to go looking...

Thanks,
          Mark.

Re: custom news urls in cms 1.9.1

Posted: Thu Dec 02, 2010 2:42 pm
by RonnyK
OK, I will do some more checking ;) but unfortunately my dev-box is not running with mod_rewrite on...

Ronny