"Create basic pages" tutorial, got stuck with "news model"

edited February 2011 in Modules
Hi,

I have discovered FUEL Cms few days ago and I really got impressed with it. I have to say thank you for the work you did. I really hope I will be able to get Fuel CMS known better and will be able to create some projects with it :)

I have started with simple tutorial, which is located here: http://www.getfuelcms.com/user_guide/general/creating-pages

However, I am encoutering problem in the very end of the tutorial with news model. I am able to create and edit news in admin backend.

View with news is also loaded and shown normally after accessing : http://localhost/fuelcms/news/

However, after accessing the detail of news: http://localhost/fuelcms/news/my-first

I got 404 error...

Fuel is trying to find page in views/news/my-first.php and it obviously does not find it ...

Is there any chance that error could be in the last part of tutorial, where I should create a file news.php in _variables folder with following content?
<?php
$var['news'] = array('view' => 'news');
?>


Or whereelse could be the problem? Thanks for any hint ;)

Comments

  • edited February 2011
    I believe you are right in that by adding $vars['news'] = array('view' => 'news'); should fix that (note the "s" at the end of $var... that was a typo in the user_guide that I've fixed now). You could also add to that _variables/news.php file
    $pages['news/:any'] = array('view' => 'news');
  • edited 10:02PM
    Thank you very much for such a swift answer. This did that trick and now it works.

    I am going to follow the rest of tutorials and training stuff, so this was probably not my last "I got lost" post in this forum :)) I hope I will be soon able to post one in "What Have You Built With FUEL CMS?" :)
  • edited February 2011
    Great! look forward to seeing what you've built.
  • edited March 2011
    I suggest to add this line
    $pages['news/:any'] = array('view' => 'news');
    to the Creating Pages tutorial, because without that the example not works. Or only just me?
  • edited 10:02PM
    Hey terdelyi... I just responded to your post. I believe that line is at the very bottom of the Creating Pages tutorial page (I swear I didn't just put it there :-)
  • edited 10:02PM
    Sorry for bumping this old post but i tried the same tutorial and kept on getting 404 errors. I tried the stuff in this topic but it didn't work, it kept on loading the main.php layout instead of the news.php view.

    After that i changed the news variables file from

    $vars['news'] = array('view' => 'news');

    to:

    $vars['view'] = 'news';

    and it suddenly worked. Is the tutorial wrong or am i doing something wrong?
  • edited 10:02PM
    Thank you for posting. That is a typo in which I'll change.
Sign In or Register to comment.