roelof Posted June 15, 2013 Share Posted June 15, 2013 Hello, I have this structure dagboek ----- 2005 -------- january ------- februari ------2006 ------january ------februari And now the client wants to start with januari 2005 and when the last article is displayed the next article displayed is the one of january 2006. Is this possible in PW ? Roelof Link to comment Share on other sites More sharing options...
kongondo Posted June 15, 2013 Share Posted June 15, 2013 Roelof, I do not mean to be rude. I would really love to help you but am finding it rather difficult at the moment for three reasons. One, you have started interrelated threads and posts in various places and I just can't keep up. Second, I am not sure how comfortable you are with PHP and PW. Stating this can be helpful so that people responding to your questions don't make assumptions. Third, I think it would be appreciated if your questions were more specific. Take for instance your question above are you talking about pagination? Are you talking about a menu? Or are you talking about listing latest articles? What exactly does the client want to do? What have you tried? How did it go? Again, I don't mean to be rude but I think you will get better answers if you heed to these simple suggestions: 1. Please try and post in one thread before opening another 2. Please be more specific with your questions. i am not a moderator in these forums so this is just plain advice from one newbie to another. I mean no offence; I only wish to see you get the answers you need. Building sites in PW should be enjoyable, not frustrating and I wish that your experience with the system is enjoyable. Thanks for reading. Cheers/k 1 Link to comment Share on other sites More sharing options...
roelof Posted June 15, 2013 Author Share Posted June 15, 2013 Hello, Oke, Im talking about pagination. Im building a sort of journal with this idea ( 20thingsIearned.com) I have tried nothing yet. I know I can use $page-> next to get the next article of a month but I try to figure out when that is a Nullpage how I can goto the next parent of that year. For example if the last article of let's say january is displayed the first article of februari is displayed when the user pressed next. Roelof Link to comment Share on other sites More sharing options...
slkwrm Posted June 16, 2013 Share Posted June 16, 2013 You can do something like this: echo "The next article is:"; $id = 0; //check if there's this month next article if ($id = $page->next->id); //check if there's next month article elseif (count($page->parent->next->children)) { $id = $page->parent->next->children->first()->id; } //heck if there's next year article elseif (count($page->parent->parent->next->children)) { if (count($page->parent->parent->next->children->first()->children)) { $id = $page->parent->parent->next->children->first()->children->first()->id; } } if (!$id) echo "This is the end my friend."; else { $p = $pages->get($id); echo "<br /><a href='{$p->url}'>{$p->title}</a>"; } You have to put this code in your article template. It suggests that you don't have month pages without articles.Kongondo is totally right that you have to be comfortable with PHP, HTML, CSS at least at the beginner's level to enjoy the benefits of ProcessWire. ProcessWire propels experimentation and creativity so you could go ahead and modify the code for finding previous articles as your homework 2 Link to comment Share on other sites More sharing options...
teppo Posted June 16, 2013 Share Posted June 16, 2013 @roelof: you might also want to check out this thread: http://processwire.com/talk/topic/3714-how-to-do-this/. Unless I'm misinterpreting something here it's essentially the same question. By the way: when starting new discussions, you really should try to include something about your question in the thread name itself. It's difficult to find related discussions when they're named like "How to do this", "How can I do this" etc. Just another friendly forum tip.. 1 Link to comment Share on other sites More sharing options...
Soma Posted June 16, 2013 Share Posted June 16, 2013 It's the famous "how to do this" question. Link to comment Share on other sites More sharing options...
roelof Posted June 18, 2013 Author Share Posted June 18, 2013 Last question before I can really can begin with building. Can I somehow check if a page is the front/home page. I need there another css file then all the other pages. Roelof Link to comment Share on other sites More sharing options...
kongondo Posted June 18, 2013 Share Posted June 18, 2013 if ($page->id==1) {echo "you are on the home page"};// if the ID of this page is 1, then it is the homepage OR if(!$page->parent->id) echo "You are on the homepage";//Means, if this page has no parent, then it must be the homepage Actually, there is a lot of useful information in the documentation: http://processwire.com/api/variables/page/. It's worth having a look at 2 Link to comment Share on other sites More sharing options...
roelof Posted June 18, 2013 Author Share Posted June 18, 2013 Thanks, I hope now I can get my custom made layout working very soon. Roelof Link to comment Share on other sites More sharing options...
Wanze Posted June 18, 2013 Share Posted June 18, 2013 Another way, assuming that you have a 'home' template: if ($page->template == 'home') echo 'Yeah baby, on the homepage!'; Link to comment Share on other sites More sharing options...
roelof Posted June 19, 2013 Author Share Posted June 19, 2013 Hello, I have a fixed text which will be only visible on the front/home page. Can I better leave this in the template file or can I better use a custom field for it. Roelof Link to comment Share on other sites More sharing options...
kongondo Posted June 19, 2013 Share Posted June 19, 2013 I think I have read somewhere in the forums people say if it is fixed and won't change, why waste PHP resources? Stick it in the template file . Up to you ultimately... 1 Link to comment Share on other sites More sharing options...
roelof Posted June 19, 2013 Author Share Posted June 19, 2013 Another problem. I made my templates with as example the skyscrapers theme. You can see it here: https://bitbucket.org/rwobben/site-tamara/src But the FrontPage is only white and when I want to go to the backend I see a 500 error. Before the changes everything works well. Roelof Link to comment Share on other sites More sharing options...
kongondo Posted June 19, 2013 Share Posted June 19, 2013 Turn debug on (in dev site only) or check in /site/assets/logs/errors.txt. What messages do you get? Have you checked your paths are correct? In Firebug or other web console, what errors do you see? Did you follow all the instructions listed here? I couldn't see anything in your link above; I mean, I don't know what am supposed to be looking at. Link to site maybe? Link to comment Share on other sites More sharing options...
roelof Posted June 19, 2013 Author Share Posted June 19, 2013 Link to the site : http://test.tamarawobben.nl I could turn on debug but as I said I also cannot log into the back end with a 500 error message Roelof Edit 1 : and I see this error messages on error.txt : 2013-06-19 10:09:50 guest http://test.tamarawobben.nl/dagboek/login/ Error: Exception: Template file does not exist: '/home/vhosting/c/vhost0008707/domains/tamarawobben.nl/htdocs/test/site/templates/admin.php' (in /home/vhosting/c/vhost0008707/domains/tamarawobben.nl/htdocs/test/wire/core/TemplateFile.php line 67) 2013-06-19 10:49:59 guest http://test.tamarawobben.nl/http404/ Error: Exception: Template file does not exist: '/home/vhosting/c/vhost0008707/domains/tamarawobben.nl/htdocs/test/site/templates/basic-page.php' (in /home/vhosting/c/vhost0008707/domains/tamarawobben.nl/htdocs/test/wire/core/TemplateFile.php line 67) 2013-06-19 10:50:02 guest http://test.tamarawobben.nl/http404/ Error: Exception: Template file does not exist: '/home/vhosting/c/vhost0008707/domains/tamarawobben.nl/htdocs/test/site/templates/basic-page.php' (in /home/vhosting/c/vhost0008707/domains/tamarawobben.nl/htdocs/test/wire/core/TemplateFile.php line 67) 2013-06-19 10:50:13 guest http://test.tamarawobben.nl/http404/ Error: Exception: Template file does not exist: '/home/vhosting/c/vhost0008707/domains/tamarawobben.nl/htdocs/test/site/templates/basic-page.php' (in /home/vhosting/c/vhost0008707/domains/tamarawobben.nl/htdocs/test/wire/core/TemplateFile.php line 67) 2013-06-19 10:50:13 guest http://test.tamarawobben.nl/http404/ Error: Exception: Template file does not exist: '/home/vhosting/c/vhost0008707/domains/tamarawobben.nl/htdocs/test/site/templates/basic-page.php' (in /home/vhosting/c/vhost0008707/domains/tamarawobben.nl/htdocs/test/wire/core/TemplateFile.php line 67) Which are right. I deleted all the those templates. Roelof Link to comment Share on other sites More sharing options...
kongondo Posted June 19, 2013 Share Posted June 19, 2013 What about error.txt; what does it report? Link to comment Share on other sites More sharing options...
roelof Posted June 19, 2013 Author Share Posted June 19, 2013 see previous message Edit 1 Link to comment Share on other sites More sharing options...
kongondo Posted June 19, 2013 Share Posted June 19, 2013 There you go. Is it the whole functionality of the Skyscrapers profile that you are interested in or is it the theme itself (html and css)? If the former, then install the profile as per the instructions then edit it in small chunks, testing along the way that you haven't broken anything. If the latter, then you can grab that from the "view source" in your web browser or by grabbing what you want from the template files.. Link to comment Share on other sites More sharing options...
roelof Posted June 19, 2013 Author Share Posted June 19, 2013 Im interested in the manner which the theme is build. But if there a easier or better way to build it Im in. This is my first build in PW so Im looking for a good way to build a site. Link to comment Share on other sites More sharing options...
kongondo Posted June 19, 2013 Share Posted June 19, 2013 Then, maybe do as I have suggested. Install it as per instructions, then edit it in small chunks and testing as you go along. Btw, ideally, I think, you should try to develop your sites locally (WAMP, XAMPP, etc..) Link to comment Share on other sites More sharing options...
roelof Posted June 19, 2013 Author Share Posted June 19, 2013 Oke, I can try that. Can I install the profile and the Pw files both with git or does that give problems. Roelof Link to comment Share on other sites More sharing options...
kongondo Posted June 19, 2013 Share Posted June 19, 2013 You can fork it in Git to your computer (very easy if you are on windows) - or just download it and install normally.. Link to comment Share on other sites More sharing options...
roelof Posted June 19, 2013 Author Share Posted June 19, 2013 Did all the steps exactly as described but no skyscrapers site only 500 error or the old backend. I think I give up on PW sadly. Roelof Link to comment Share on other sites More sharing options...
kongondo Posted June 19, 2013 Share Posted June 19, 2013 Sorry it didn't work out for you. Maybe, take a break from it. If you decide to come back to it, start by reading up on the docs, take small steps, complete the simple site tutorial....ease into it... Link to comment Share on other sites More sharing options...
roelof Posted June 19, 2013 Author Share Posted June 19, 2013 I did all the steps and im also sorry that it did not work for me. I still think the last problem is more a theming problem then that I do not understand how PW works, Roelof Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now