FUEL-CMS-Blog-Module icon indicating copy to clipboard operation
FUEL-CMS-Blog-Module copied to clipboard

news scroll

Open gul-ahmad opened this issue 10 years ago • 5 comments

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

gul-ahmad avatar Oct 29 '14 07:10 gul-ahmad

??? i have done the second part using custome code and first issue is remaining

gul-ahmad avatar Nov 10 '14 06:11 gul-ahmad

To change the URI path, you'll need to do 2 things:

  1. Add a route to your fuel/application/config/routes.php file:
$route['news(/.+)?'] = 'blog$1';
  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

daylightstudio avatar Nov 10 '14 17:11 daylightstudio

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.

valerymihaylov avatar Aug 21 '18 20:08 valerymihaylov

Try using $route['news(/.+)?'] = 'blog$1'; instead of $route['news(/:any)?'] = 'blog$1';. I believe CI what :any captured.

daylightstudio avatar Aug 21 '18 20:08 daylightstudio

Ok I manage to do it. This is the steps i make :

  1. 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.

valerymihaylov avatar Aug 21 '18 20:08 valerymihaylov