Jump to content

OllieMackJames

Members
  • Posts

    356
  • Joined

  • Last visited

Everything posted by OllieMackJames

  1. Thanks soma, I take it you mean this code: $pageNum = $input->get->page ? $input->get->page - 1 : 0; $limit = 5; $start = $pageNum * $limit; $result = $page->children("start=$start, limit=$limit"); echo $result->renderPager(); foreach($result as $p) echo "<p>$p->url</p>"; echo $result->renderPager(); I tried that as well and that first gives me - the paginated pages - it seems to add one page extra to the end of the paginated pages with an overisight of next paginated pages plus 5 more pages in the pw tree - then it shows the paginated pages again So this also sends me in a direction that shows more of what pw can do when someone who understands coding has a go at it, but I have to admit I am pretty much clueless with code, and all I can do is copy paste. But I think I understand what I want pretty clear and that is paginate a list of results and only show the next link at the bottom of any of the paginated pages, excluding the last paginated page of course, since that one shows the bottom of the results. I have changed the first post of this thread because judging by the reactions of others I have done a poor job of explaining what I would like, my bad, so let me try to correct that here as well: OK here goes: currently the pagination module outputs the following: - on the first paginated page it shows: 1 2 3 next - on the second paginated page it shows: prev 1 2 3 next - on the last it shows: prev 1 2 3 And I want it to show this: - first paginated page: next - second paginated page: next - last paginated page: you have reached the bottom, thanks for checking this far! Infinitescroll.js looks in the page for the next link and then uses this next link to read the output of the next paginated page and appends it to the current page, that will give me the efect that is used on pinterest and also on facebook where once you scroll down it just keeps adding to the current page. Thanks again, I hope someone can point me to the solution, I have now downloaded the pagination module and am looking in the source there to figure out how to just get it to show the next link only.
  2. @leoric, Thanks for thinking along, tried that but that does not work like it should. seems to me that the $page->next->id etc code is part of the core of regular pw, my question focuses on code that works with the pagination core module, and the page->next takes something from the tree, it takes the next sibling, but with pagination there is no real sibling, but only an automatic split up of a page. Par example I might have 50 results to the call: $results = $pages->find("template=blogpost-iframe, limit=10"); Then the pagination module kicks in and paginates the results into 5 pages with each 10 results, so it adds 'virtual' pages that can only be found and called by the paginationmodule, so that is why your code does not work here I believe. I might understand it wrong, but this is how I think it works, I therefore need focused input on how to work 'under the hood' of the pagination module. But once again, thanks for thinking along, it helps me figure it out better and hopefully point others to the right direction where to seek the answer.
  3. I want to use pagination together with infinitescroll This means I need to output only the nextitem link on the bottom of each paginated page, Currently the pagination module outputs the following: - on the first paginated page it shows: 1 2 3 next - on the scond paginated page it shows: prev 1 2 3 next - on the last it shows: prev 1 2 3 And I want it to show this: - first paginated page: next - second paginated page: next - last paginated page: you have reached the bottom, thanks for checking this far! Infinitescroll.js looks in the page for the next link and calls the next pages results and appends them to the current page, like pinterest and facebook are doing. Hope this makes sense so far. So, what I need is ONLY the next link and that then also formatted in a specific way so infinitescroll recognises it and knows to load the next paginated page Here is my current code: <?php $results = $pages->find("template=blogpost-iframe, limit=10"); $pagination = $results->renderPager(array( 'nextItemLabel' => "Next", 'nextItemClass' => "jscroll-next", )); foreach($results as $result) { $imgURL = $result->images->first()->url; // original image $thumbWidth = 192; $thumbWidthPX = $thumbWidth . 'px'; $thumb = $result->images->first()->size($thumbWidth); $thumbURL = $thumb->url; $siteURL = $pages->get(1)->httpUrl; // home URL $summary = $result->summary; $title = $result->title; $blogURL = $result->httpUrl; $frontSummary = $result->frontSummary; echo <<<BLOGEOF <div class="tack"> <div class="tackHolder"> <div class="actions"> <div class="left"> <a class="button" href="http://pinterest.com/pin/create/button/?url=$siteURL/&media=$imgURL&description=$summary"><strong><em></em>Repin</strong></a> </div> <div class="left"> <div id="facebook_like_button_holder" > <a title="send to Facebook" href="http://www.facebook.com/sharer.php?s=100&p[title]=$title&p[summary]=$summary&p[url]=$blogURL&p[images][0]=$imgURL" target="_blank"><div id="fake_facebook_button" class="button"><strong><em></em>like</strong></div></a> </div> </div> </div> <a href="$blogURL" class="iframe cboxElement" title="$title"><img src="$thumbURL" alt="$title" title="$title" class="tack_img drthumbonly" width="$thumbWidthPX"/></a> </div> $frontSummary <p class="links"><a href="$blogURL" class="iframe cboxElement">Meer Informatie...</a></p> </div> BLOGEOF; } echo $pagination; ?> The aboe outputs the first 10 results and then also: <ul class='MarkupPagerNav'> <li class='MarkupPagerNavOn MarkupPagerNavFirst MarkupPagerNavFirstNum'><a href='/pw/'><span>1</span></a></li> <li><a href='/pw/seite2'><span>2</span></a></li> <li class='MarkupPagerNavLastNum'><a href='/pw/seite3'><span>3</span></a></li> <li class='jscroll-next MarkupPagerNavLast'><a href='/pw/seite2'><span>Next</span></a></li> </ul> It should only output: <class='jscroll-next'><a href='/pw/seite2'><span>Next</span></a> or something like that Help much appreciated!
  4. Thanks for that pwired, great links, but it is not totally me I guess, I moved to processwire about a year ago, but still have some sites that are not ported. I really like pwire, it is fast, easy and lots and lots more, BUT I am not a programmer/coder so I just need help porting. Thanks again, and if anyone is interested/willing, drop me a pm. thanks!
  5. I have a modx evo site that was ported from a wordpress theme. I would like to now have this site ported to processwire, the design is fairly simple, the functionality uses masonry jquery js and infinitescroll js Please pm for more details, I'll then show you the current site and you can look at the functionality and give me a quote. Thanks!
  6. I second that, looking into nginx as well! edit: found it here: http://processwire.com/talk/topic/3246-nginx-directives-for-procache/
  7. @Wanze no problem at all to mess up my thread I got an answer and if Ryan chimes in and your thinking leads to a further improvement, even better still! PW rocks! And the community as well!
  8. Thanks horst and teppo! I went with: $next = ($page->numChildren) ? $page->child : $page->next; if ($next instanceof NullPage) $next = $page->parent->next; echo ($next instanceof NullPage) ? "This is the end" : "<a href='{$next->url}'>{$next->url}</a>"; and that just seems to work fine. Teppo, i do not understand the trouble you mentioned but would sure like to know what not to do so apache will not come crashing down... Other question I have with this solution is whether this will slow the site down considerably or not, because now for every page rendered I am probably asking processwire to check the tree first before rendering. Currently on the site I am using this on, there is a couple hundred pages, I am using procache, but still I would like to know how this affects speed. tnks!
  9. I have the following structure p1 -p1page2 -p1page3 -p1page4 p2 -p2page2 -p2page3 -p2page4 etc Now at the bottom of each article I want a link to the next article. So it should go like this: p1 links to p1page2 links to p1page3 links to p1page4 links to p2 links to p2page2 links to p2page3 etc. etc. I am using: <a href="<?php echo $page->next->url ?>"><?php echo $page->next->title ?></a> But that only gives me a next page on the same level, it does not traverse up or down the tree. What code do I need for this to traverse down when needed, then horizontal and then back up again. Thanks!
  10. Ryan, only getting around to working with it, all seems to work great and very fast! Thanks
  11. Teppo, thanks, will give that a try. For now I got Radek's solution working. I only need this one redirect so just made one extra template for this, without adding an extra field. The url is now hard coded like Radek showed. Radek thanks again!
  12. Thanks for the reply, tried that as follows: I made a page /log-in/ so it appears in the menu I redirected /log-in/ to http://www.domain.com/target-url.html But it does not work, it now shows the pw page for /log-in/ Radek, thanks, have not tried your solution yet, do not see yet how to include this in the menu, but will try.
  13. How can I redirect to a page outside PW? I have tried the following: - I made a field called redirect with type=url - I also made a redirect.php template with the following code: <?php $session->redirect($redirect); ?> Then I made a page called Log In that uses template redirect I set the redirect field to : http://www.domain.com/desired-page-outside-pw.html When I view the page I get this error: The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. Any ideas how to do this?
  14. Hi Stefan, Just a question, it looks like your solution is meant to include the extra files that are used with the minify module, but are currently outside the logical dir path. If so, would you be willing to share the solution? It would be an answer to my post here: http://processwire.com/talk/topic/1537-minify/ thanks!
  15. Hi pwired, I like what you said: Here's what I learned over the last 9 years of making money online, allow me to use the analogy of a sport I love: sailing. If there is no wind, no use putting your sailing boat out on the water... If there is wind, anybody who puts a boat out on the water will be able to move, and the better sailers just go faster up and downwind. No matter how good a sailor you are, if there is no wind, you are just as lost as anybody else. So what do I mean with this? There are lots of markets out there, but you need to find a market where people are spending money everyday, this is the wind. Once you found a spot like that, all you need to do is get your boat out on the water and catch some of that wind. OK, so you want to make money with pw and internet, here's a business example from the wordpress world: www.clickbump.com Scott Blanchard, the clever brain behind it, focuses on a number of things that make wordpress sites driven by his stuff, very fast and do well in the serps. Even though I sort of hate wordpress, and refuse to use it for my important sites, I have bought his stuff and a number of his templates on top, just to figure out what works well and to be able to port that stuff to my sites. So if I would want a business model like this I would focus on making nice ready made sites or modules that would work great and help people get results in the serps. The only trouble of course with this business model is that the current wind is mainly on the wordpress lake, but if you can make things easy enough for people, you would catch some of that wind, there's strategies to do that. OK, let me think along in another direction. How about you check the google adwords tool for certain keywords, you want keywords that have a lot of traffic and relatively high cost per click in google adwords. Once you find that, you know this is a market where money is spent, simply because these advertisers would not keep spending if they would not make money with it. Next you do a search on google for the very same keyword and you check the top 3 adwords advertisers - check out their sites and see what is lacking there. On page seo wise, or on site engagement wise,etc. etc. Next you could do two things (at least of course): 1 - build a site around the niche and get it to the top of google search results, then contact the advertisers and offer them the site for rent (once you are in the top 3 of organic results you will get nice traffic and be able to show your numbers and rent the site out for a percentage of the traffic x cpc. 2 - contact the site owners and tell them you can help them with redesign of their site so it gets more visitors and/or get more action out of current visitors. Now a third option: - build kick ass modules for pw and charge for them. I would already have some ideas for at least one kick ass module that I just bought today from the wordpress world that would really benefit anybody with a site out there that is currently driven by pw. As you see I am not so much focused on what you are good at, but how to apply what you want to do at where people are currently spending money. Of course you need to be good or get good at coding and stuff, but a guy with a focus on existing needs that can be met, in my book always beats the guy who focuses on what he wants to do. Hope this helps, may the winds favor your business sails!
  16. Thanks for all the input! I incorporated a bit of different input to make something short and it works nicely. I shortened it to: <?php $randomTesties = $pages->find('template=testie, sort=random, limit=10, id!='.$page->id); if(count($randomTesties)){ foreach ($randomTesties as $randomTestie) { $class = ($count & 1) ? 'testiecolalt' : 'testiecol'; ?> <div class="<?php echo $class; ?>"> <div class="testie"><h4><?php echo $randomTestie->testie_header; ?></h4> <div class="testiequote"><?php echo $randomTestie->body; ?></div> <h5><?php echo $randomTestie->testie_name; ?></h5></div> </div> <?php } } ?>
  17. Soma, thanks, I already have this whole code section as an include so did not want to go to another include again. I did try your abbreviations but only get one (1) result to show, here's the code I tried in stead of the earlier version: <?php $randomTesties = $pages->find('template=testie, sort=random, limit=10, id!='.$page->id); if(count($randomTesties)){ foreach ($randomTesties as $key => $randomTestie) { $class = ($key % 2 == 0) ? 'testiecolalt' : 'testiecol'; } ?> <div class="<?php echo $class; ?>"> <div class="testie"><h4><?php echo $randomTestie->testie_header; ?></h4> <div class="testiequote"><?php echo $randomTestie->body; ?></div> <h5><?php echo $randomTestie->testie_name; ?></h5></div> </div> <?php } ?> What am I missing here?
  18. Thanks kongondo and diogo, now the code starts to make sense AND it works, before it only worked, thanks to onjegolders! This to me seems a nice example of being able to do all sorts without needing an extra templating engine like ditto! Starting to enjoy myself more and more with PW!
  19. thanks onjegolders! I do not understand all the code, but managed to adapt it to the following: <?php $randomTesties = $pages->find('template=testie, sort=random, limit=10, id!='.$page->id); $count = 0; $class = ""; foreach ($randomTesties as $randomTestie) { $count++; if ($count % 2 == 0) { $class = "testiecolalt"; } else { $class = "testiecol"; } ?> <div class="<?php echo $class; ?>"> <div class="testie"><h4><?php echo $randomTestie->testie_header; ?></h4> <div class="testiequote"><?php echo $randomTestie->body; ?></div> <h5><?php echo $randomTestie->testie_name; ?></h5></div> </div> <?php } ?> And it works! Thanks lots! The following code I do not understand what it does: $count = 0; // Suppose this is just setting the starting point for counting? $class = ""; // Suppose this makes it empty, waiting to be filled? foreach ($randomTesties as $randomTestie) { $count++; //keep counting? if ($count % 2 == 0) { // if count divided by 2 equals zero? Just trying to bend my head around php here. It works anyways so thanks again!
  20. EDIT: this topic is solved, I added the solution I now use in this first section. With thanks to all the contributors in the thread. OK, the question was: How to port the following modx Ditto call: especially the tpl and tplAlt thing. [!Ditto? &parents=`28` &depth=`2` &tpl=`best-article-tpl` &tplAlt=`best-article-tplAlt` &randomize=`1` &display=`4` &showInMenuOnly=`1` &filter=`id,[*id*],2|id,69,2|id,116,2|id,117,2|id,124,2`!] The results should be formatted with alternating: <!--best-article-tpl--> <div class="testiecol"> <div class="testie"><h4>[+testie-header+]</h4> <div class="testiequote">[+testie-text+]</div> <h5>[+testie-name+]</h5></div> </div> <!--best-articel-tplAlt--> <div class="testiecolalt"> <div class="testie"><h4>[+testie-header+]</h4> <div class="testiequote">[+testie-text+]</div> <h5>[+testie-name+]</h5></div> </div> Here's how I ended up doing it, thanks to onjegolders, soma, kongondo, diogo, macura73 and others. Ok Here's the code: <?php $randomTesties = $pages->find('template=testie, sort=random, limit=10, id!='.$page->id); if(count($randomTesties)){ foreach ($randomTesties as $randomTestie) { $class = ($count & 1) ? 'testiecolalt' : 'testiecol'; ?> <div class="<?php echo $class; ?>"> <div class="testie"><h4><?php echo $randomTestie->testie_header; ?></h4> <div class="testiequote"><?php echo $randomTestie->body; ?></div> <h5><?php echo $randomTestie->testie_name; ?></h5></div> </div> <?php } } ?> Works like a charm!
  21. I can confirm it works ok on production, at least that's where I'm using it. Thanks Soma!
  22. Works easiest with modules manager: download from http://modules.processwire.com/modules/modules-manager/ install and then go to setup -> modules manager and from there you can download install and or update modules right from within pw, works like a charm!
  23. Hi Teppo, great link you posted http://www.seomoz.org/blog/googles-unnatural-links-warnings Ryan, I think if you read that article, you will be up to date pretty much, there is much more of course, but this gives good pointers. Also do please read the comments below on that page, because what happened to seomoz is not really what happens to smaller sites. SEOMOZ already had lots of back links and also has and had a very active sydication strategy of their content, so they are harder to take down. Regarding your attribution text suggestion, I would just take that as one of the options, nowadays g seems to recognize use of brandnames as well and gives the brand name owner credit for that as well. This whole seo field is a bit of a mine field, and I am hopeful g will try to correct the spam-your-competitor-possibilities, but I am not holding my breath... I would not hesitate to use attribution links as I proposed, and if you build an option in it to change all links to attribution text only upon an update of the module, you are covered all ways. Now one final remark here, regarding seo smarts, g now heavily seems to look at the environment where the link exists. It used to just be enough to have a link with the anchor text that you wanted to rank for and spammers apparently spammed the living daylights out of this, then g wisened up and started looking more at the text around the link, so spammers found that out as well and put links in text snippets about the topic. Then the link networks jumped in, allowing people to post articles about certain topics that were then posted to many sites, and we have all seen thoses sites I suppose, they add no value whatsoever and can be recognized a mile away. Of course g wrote an algo that recognizes those sites. Then also the panda algo came aroud, focusing on bounce rate, time on site, etc. etc. GREAT! this helps people who have great sites that help people with great content that people want so much that they stay around. The penguin update was all about over optimisation, either on page, or intra-site-linking, and outside back-links. Now one final thing about outside links: it gets more and more important that links come from sites that are related to your topic. So with that in mind, maybe - next to the module above - ask developers/designers to link to your site with an explanation on a page where they write a review about processwire and why they use it, and have them put a link in that article to processwire. But the best ambassador should always be processwire itself. If someone wants to develop a module, I would be happy to think along and help with the concept and testing, great to hear that the markup module apparently can be of service there. Wishing you all happy PW-ing!
×
×
  • Create New...