Cannot figure out Pagination + custom design |
[eluser]Zero-10[/eluser]
I've been really good at figuring stuff out on my own but the Pagination system is insanely confusing for some reason. I created my own gallery where images can be uploaded and stored via database and the data is displayed fine with the pagination. However, I cannot figure out how to display the results with pagination. My main goal is to get a comment system for articles, and the gallery was used as a way to figure things out and won't be code used in the future. I'm just stating that I managed to use the pagination (table) correctly. Files: Controller/entertainment/article Models/articles/entertainment Views/entertainment/index | Views/entertainment/comments Example of URL: http://www.fakeurl.com/entertainment/4/title-of-article 4 = articleid title-of-lesson = isn't mandatory but is good for SEO Article Controller (comments function) Code: //removed a bunch of code that is not important for this question like phpbb stuff Models/articles/comments Code: <?php View/entertainment/comments -- No point in adding header and index files -- Code: <? if ($cm_query->num_rows() >0): ?> I have read like 15 different tutorials (they are all the same copypata), watched the nettuts video, and even went on youtube and other video sites for other screencasts but they don't go into how to customize it. Eventually I would love to have a "load more comments" with jquery but I'll be more than content with getting this done. Thank you for your time!
[eluser]Zero-10[/eluser]
Almost 3 days has gone by so I'm bumping this for interest. I haven't figured this one out yet
[eluser]boltsabre[/eluser]
Quote:and the data is displayed fine with the pagination. However, I cannot figure out how to display the results with pagination.Not really sure what your problem is, you said the data is displayed fine with pagination, and then the very next sentance you say its not working, can you please reword this for us. Quote:I’m just stating that I managed to use the pagination (table) correctly.So is pagination working or not? Very confused.... Quote:Files: So okay, if you want SEO urls (ie, segment 3 above), you'll have to write your own helper (and perhaps form validation class extension with a custom rule). In your helper, before entry of the title to the DB (you'll have to make an extra table field for this to store it in) you'll have to strip all non alpha/numeric/hyphan characters from your string, and then replace all spaces with hyphans. This can get complicated if you want to (consider a user enters this for a title: "this is my title ", your resulting seo friendly url will be "http://www.fakeurl.com/entertainment/4/this------is------my-title----/". Anyway, again, im not really sure what the problem is, if you could re-clarify then perhaps you'll get some more answers! good luck, i'll check back later and see what you've posted.
[eluser]InsiteFX[/eluser]
For one you did not say what version of CodeIgniter you are using! But if your using CodeIgniter 2.0.+ then your Controller and Model are wrong! CI 2.0.+ Controller extends CI_Controller Model extends CI_Model Constructor is: Code: public funtion __construct() InsiteFX
[eluser]Zero-10[/eluser]
I'm using 1.7 without plans of upgrading since my personal project is already 95% complete. The default pagination table displays data from the database but I don't want that ugly looking table. It looks like something used for testing purposes. I want to make something that involves a dozen divs with relative and absolute properties and a lot of CSS. If I tell the pagination to get data from the database using the default table class then it will do it but I don't want to use it for the reasons mentioned above. I want to select certain columns and display what i want when i want it in the result tag (<? foreach($cm_query->result() as $row): ?>) Thanks for your time and the responses so far! EDIT: Don't worry about the SEO thing, that was the first thing I did with this project, I'm just saying that the last piece in the url isn't mandatory so you can still access it without it. I was saying that in the event that the url parameter needed to be increased or decreased by 1. |
Welcome Guest, Not a member yet? Register Sign In |