FUEL-CMS-Blog-Module
FUEL-CMS-Blog-Module copied to clipboard
news scroll
hi thats a great plugin i have menu page on which i am showing news using the blog module i need some more in it but not getting how to change your module like i want following 1-i want there should be /news instead of calling it as /blog in the url to go to news section 2-and i want to show the news/posts on my home page which lies in views folder i want to show the news in scroll how i can do this
??? i have done the second part using custome code and first issue is remaining
To change the URI path, you'll need to do 2 things:
- Add a route to your fuel/application/config/routes.php file:
$route['news(/.+)?'] = 'blog$1';
- Log into the CMS and got to Settings-> Blog then change the "URI" to "news"
To add the contents to your homepage, you can get a list of recent news items by doing the following:
$recent_posts = $CI->fuel->blog->recent_posts(5);
foreach($recent_posts as $post):
echo $post->title;
endforeach;
The fuel/modules/blog/libraries/Fuel_blog.php file has a bunch of methods on it you can use: http://docs.getfuelcms.com/modules/blog/fuel_blog
Hello, i am doing everything to change url from "blog" to "news" and it change but after i click under post it gives me 404 page not found. Post is open only under "blog/year/month/day/name-of-the-post".
What i need to do?
Please help me.
Try using $route['news(/.+)?'] = 'blog$1';
instead of $route['news(/:any)?'] = 'blog$1';
. I believe CI what :any
captured.
Ok I manage to do it. This is the steps i make :
- Change fuel/modules/blog/config/blog.php file: $config['blog']['uri'] = 'news';
2.Add in fuel/applications/config/routes.php: $route['news'] = 'blog'; $route['news(/.+)?'] = 'blog/$1';
3.Log in to cms and go to settings -> Blog and change "blog" to news on URI.
Erase all cache from browser and cms.