-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
I would go with the child pages strategy. the tree could be organized like this: home -home_content ---area1 (give meaningful names to these) ---area2 ---area3 ---... -about -whatever -etc "home_content" need a template, but not a template file. Not having the file will hide it and it's children from the website (see answer #17 below http://processwire.com/talk/topic/4487-homepage-with-multiple-content-areas/?p=47926). The "area" pages would have their own template files (no header, no footer, only their own markup): <h2><?php echo $page->title?></h2> <?php echo $page->body?> Then you can build the homepage like this: <body> <h1>Look at my nice areas of content!</h1> <section id="area1"> <?php echo $pages->get("/home_content/area1/")->render()?> </section> <section id="area2"> <?php echo $pages->get("/home_content/area3/")->render()?> </section> <section id="area3"> <?php echo $pages->get("/home_content/area3/")->render()?> </section> <section id="area4"> <?php echo $pages->get("/home_content/area4/")->render()?> </section> </body> edit: or, if you get easily tired of typing <body> <h1>Look at my nice areas of content!</h1> <?php foreach($pages->get("/home_content/")->children as $c) { echo "<section id='{$c->name}'>"; $c->render(); echo "</section>"; } ?> </body>
-
Check the name of the admin page in the database just to be sure. The id is 2.
-
From the documentation of the module https://github.com/somatonic/MarkupSimpleNavigation#markupsimplenavigation-116 $options = array( 'parent_class' => 'parent', // overwrite class name for current parent levels 'current_class' => 'current', // overwrite current class 'has_children_class' => 'has_children', // overwrite class name for entries with children Those are the options that let you modify classes, check all the other options also. They are many
-
Pronto, back to my normal avatar and time for bed
-
Ok, this is just for now. I will put the other image back in some minutes
-
Moved some posts that where polluting this one (also my fault ) http://processwire.com/talk/topic/4479-avatar-for-pwired/. Sorry for that Manaus.
-
Ei Apeisa, help me out here, I'm trying to move all these avatar messages to a new thread and don't know how... we completely polluted Manaus thread (it's done now) No, not in Lisbon
-
My parents did You erased your previous comment, but now it's too late edit: now you put your comment back there and erased what you wrote after. Makes my post seem a bit schizophrenic
-
-
Let's just wait that WillyC makes one for you
-
Martijn, you are 3 months late
-
For those working with pagination and several urlSegments. This seems to be pretty bulletproof: $currentUrl = $page->url.$input->urlSegmentsStr."/"; $pagination = $results->renderPager(array('baseUrl' => $currentUrl));
-
Welcome to PW! You need to elaborate your question a bit more so we can help you. Did you read the documentation or any of the tutorials? http://processwire.com/api/ http://processwire.com/api/tutorials/development-getting-started/
-
Hm, doesn't echo anything...
-
Echoing $input->urlSegments returns a useless "Array". Would be nice if it would return "segment1/segment2/segment3/", so we could easily build the current url like this: $page->url.$input->urlSegments. What do you guys think also of having a url property for $input that returns the current url with segments and pagination $input->url? Edit: Anyway, just for reference, this can be done with $_SERVER['REQUEST_URI']. I'm only proposing a PW way
-
Any of those methods is valid. The only thing that you are doing wrong, either for readability or performance, is getting the page lot's of times "$pages->get($taskId)". So, if I would change your first block of code it would look like this: $taskId = (int) $input->post->task[$checked_player]; // extra tip. The (int) makes sure you get an integer $myPage = $pages->get($taskId); // get the page only once if ( $myPage->id ) { // if page exists // Get the task bonuses $task = $myPage->title; $new_XP = $myPage->XP; $new_HP = $myPage->HP; $new_GC = $myPage->GC; // Do the math $player->XP = $player->XP + $new_XP; $player->HP = $player->HP + $new_HP; $player->GC = $player->GC + $new_GC; } Or, and maybe now it makes more sense: $taskId = (int) $input->post->task[$checked_player]; $myPage = $pages->get($taskId); if ( $myPage->id ) { // Get the task bonuses $task = $myPage->title; // <- do you need this here? // Do the math $player->XP = $player->XP + $myPage->XP; $player->HP = $player->HP + $myPage->HP; $player->GC = $player->GC + $myPage->GC; } Edit: I left this in the "getting started" forum because you have some PW specific issues there.
-
On this line you are overriding the array news, by assigning the individual item to it. Change one of those variables to something different. Don't forget to change all occurrences of it.
-
Bumping this thread since there are many new people since the last post.
-
Another one for our German translators http://wowa-webdesign.de/allgemein/gastartikel-processwire/
-
Hm, I guess the horizontal scrollbar appears because of the borders from the input fields. There is one way of correcting the box-model that I actually enjoy using, especially for working with percentages http://www.paulirish.com/2012/box-sizing-border-box-ftw/ /* apply a natural box layout model to all elements */ *, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } That small snippet in the top of main.css would fix the problem, and allow to use overflow:auto