Retrieving Information from a Page and Displaying a Preview of it
Permalink
I have a website built using concrete5. It's main focus is written articles, and I want the most recent articles to automatically be focused on the main page.
I would like 3-5 different articles having previewed, each being bumped down a slot when a new article is published.
Would the best way to be sorting through the database and selecting the most recent, 2nd most recent etc and then using a substring to cut it off, or is there a more efficient/easier way?
I would appreciate any help given.
Thanks,
Jack
I would like 3-5 different articles having previewed, each being bumped down a slot when a new article is published.
Would the best way to be sorting through the database and selecting the most recent, 2nd most recent etc and then using a substring to cut it off, or is there a more efficient/easier way?
I would appreciate any help given.
Thanks,
Jack
The standard way to do this in Concrete5 is with the Page List block. Set it to show 5 pages of a certain type (an "article" type, for example), and leave Pagination off/unchecked.
This assumes each article is its own page -- which is generally how C5 works best. If your articles, on the other hand, are individual blocks all on one page and you just want to show the 5 most recent, that would require some custom coding. If that's the case, can you explain your situation in a bit more detail (like how the news articles are placed on the site, where they're located, what order they're in, how users add new ones, etc. etc.)? Could probably point you to some sample code if I had more details about it.
This assumes each article is its own page -- which is generally how C5 works best. If your articles, on the other hand, are individual blocks all on one page and you just want to show the 5 most recent, that would require some custom coding. If that's the case, can you explain your situation in a bit more detail (like how the news articles are placed on the site, where they're located, what order they're in, how users add new ones, etc. etc.)? Could probably point you to some sample code if I had more details about it.
Ok, I do this, but it gets stuck on the loading thing.
Not sure what the problem is, but I'll try updating C5 and see if that helps.
Not sure what the problem is, but I'll try updating C5 and see if that helps.
UPDATE:
Updating C5 did not help.
Updating C5 did not help.
What's "the loading thing"?
Here is an image:http://puu.sh/O07K
I left it like that for over 20 minutes, and it remained like that.
I left it like that for over 20 minutes, and it remained like that.
Huh... something strange is going on there, not sure what. Does that happen when you try to save any other blocks too? What happens when you reload the page -- is the page list block there now, or is it never placed on the page to begin with?
Might also want to check the log in the dashboard for any errors, and if nothing shows up there also try to check the PHP error logs on your server (you'll have to find out how to do this from your web hosting company, as its different from place to place).
Might also want to check the log in the dashboard for any errors, and if nothing shows up there also try to check the PHP error logs on your server (you'll have to find out how to do this from your web hosting company, as its different from place to place).
Other blocks seem to add fine.
Reloading does not do anything. Nothing new shows up
When I go to the dashboard logs it says there aren't any logs to show.
When I check the for the PHP error log the file does not exist.
By the way, I really appreciate your help :)
Reloading does not do anything. Nothing new shows up
When I go to the dashboard logs it says there aren't any logs to show.
When I check the for the PHP error log the file does not exist.
By the way, I really appreciate your help :)
Sorry, I wish I could be of more help, but I have no idea what the problem could be with that :(
http://www.concrete5.org/marketplace/addons/easy-news/...
Hope that helps?