Jump to content

Soma

Moderators
  • Posts

    6,798
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by Soma

  1. or if($users->get($username)){ // username found } not sure what you're doing exactly as always to give simpler solutions This would also work, foreach ($users as $u){ echo $u->name; } And if in an function scope where $users is not available: foreach (wire("users") as $u){ echo $u->name; }
  2. Maybe still no the best, but you can also use this great module by Nico to add a delete action to page tree. http://modules.processwire.com/modules/process-page-delete/ Open admin tree and browse to users, delete one after another. BTW I think this module doesn't belong to Process module but Admin Helpers, Nico?
  3. Use wire("page")->title if inside scope of a sn.. ERR function. Or with giving it through function call.
  4. First there was an object. It was so lonely and had no home so we gave him an url. It was very happy and lived long until someone came and deleted it.
  5. localSidebarText($firstline);
  6. Memory? Have you changed the field from image to crop image?
  7. http://processwire.com/api/cheatsheet/#page 5th entry in that list. $page->url is something so basic and covered all over the place on processwire.com. It's all under API, as it's the only thing you need to know to build templates/pages http://processwire.com/api/what/ http://processwire.com/api/templates/ http://processwire.com/api/variables/page/ http://processwire.com/tutorials/quick-start/navigation/ Or of course http://wiki.processwire.com/index.php/Main_Page. If not, there's even a basic site when you install PW which also is something you want to study first when starting with PW and come ask question if you don't understand something here. I think that's quite good and there's many people think PW has exceptional documentation for a OS project. For some strange reason we still have to figure out why some people think the opposite. There's also the forum which has tons of examples (might use google search to search) and simple questions get answered here mostly immediately.
  8. Sorry to correct you here diogo, but <a href="/disclaimer">Disclaimer</a> works for all levels as it's absolute starting from "/" root. Still better in PW is <a href="/disclaimer/">Disclaimer</a> as it would do a redirect to add trailing slash which is default in PW. You could also use id of the page, so even if you move the page it still get's the right url to the page. <a href="<?= $pages->get(1023)->url ?>">Disclaimer</a>
  9. It can be better explained with this: result = ifonething==something ? iftrue : iffalse;
  10. My code example would be if you have the categories as the navigation/page structure to display the products assigned to them. $page would be the category page and categories is the page field used to select the category on the products. So in simple this find find all products that have the current category page selected. I'm on category page: Boys Nightware show me all products that have Boys Nightware selected. The question you have to ask is do I need multiple categories or not.
  11. I'm officially very confused of what you both trying to archive. It all doesn't make sense to me and it seems hard to explain. You guys seem to be wired very different Either use categories structure you use as the navigation to navigate the categories, then show the products that has the current category selected. OR use categories with the products already inside and simply render them out with $page->children(), which is what NooseLadder is doing and using this approach doesn't make sense to have categories separate again. (I don't see where they would come into play when he already renders them out from the structure which already holds the categories).
  12. Ah now I get it, the PagePaths module by Ryan to query page paths. Still same as above holds true.
  13. @Jorge, I don't understand, are you making a module PagePaths that stores page paths in db? For what usage? Well unfortunately it wouldn't be useful, as the localized paths aren't same as page paths in PW but translated for each language.
  14. Why have you categories tree, and then again a product tree which has the categories again? Do you really need that? Or do you need multiple categories? The way you have it now you already have the products categorized through structure. In your example using page field you would do it like this. // on $page Boys Nightware $prods = $pages->find("template=product, categories=$page"); if (count($prods)) { foreach($prods as $product){ // output prod } }
  15. Unless you have not thousands of child pages in one branch I dont see much speed issues. Also theres options to add id to name which will allow even some more. Ive never used cacheing in pw and have some heavy sites I did not notice getting slow. Pw is fast and allows for scaling you might think it needs cache as with other systems.
  16. Ok back on laptop. I corrected my code example with "n" and missing bracket. Thanks for pointing out, but I wrote it in the browser and didn't test. Glad you figured it out finally It can take time to adapt brain to PW but it's worth. Concerning your publish month question. The current example with getting current month doesn't require a publish unpublish scenario. If you would really want to make it it would be as simple as getting the published page from the parent with children(selector). This function will only return pages that are published and not hidden. // return published and visible children from /empfehlungen/ $menues = $pages->get("/empfehlungen/")->children("template=empfehlung_list"); if(count($menues)) { foreach($menues as $child) echo $child->render(); } else { echo "Keine Menues gefunden."; } // return all children, even hidden $menues = $pages->get("/empfehlungen/")->children("template=empfehlung_list, include=hidden"); // return all children, even published and hidden $menues = $pages->get("/empfehlungen/")->children("template=empfehlung_list, include=all");
  17. The parent in the selector is wrong.. Just need the path as in my second post.
  18. Obviously nothing helps but call support of that hosting...
  19. I have php 5.2.9 and works all well. I don't think there legacy version. As I said earlier you might check if $config->userAuthHashType = "sha1" is supported by your server or need different setting. Also check php info to see if mcrypt blowfish is installed and what hash engines are available.
  20. Hmm, The error you mention can't be found in PW, so is it an php error? Maybe something to do with PHP install and $config->userAuthHashType = 'sha1'; ?
  21. Have checked session folder perms or delete them and cookies? Can you try using db session or are you using it?
  22. Also instead of doing $pages->get("parent=/empfehlungen/, name=$curr_month")->children->find("template=empfehlung_list"); You can do just $pages->get("/empfehlungen/$curr_month/")->children("template=empfehlung_list");
  23. Don't make things complicated Since php generated date strings are english you'd have to name you pages in english or use a mapping. Diogo already posted some code with using eq(n) which would take the position in the pages tree to get the current month. Here's another example how I would do it with using month names. $month = date("n"); // month integer $month_names = array("januar","februar","maerz","april","mai","juni","juli","august","september","oktober","november","dezember"); $curr_month = $month_names[$month-1]; $menues = $pages->get("/empfehlungen/$curr_month/")->children("template=empfehlung_list"); if(count($menues)){ foreach($menues as $child){ echo $child->render(); } } else { echo "Keine Menues gefunden."; } In selector you should use "field=$value" instead of 'field=$value', or the variable won't get parsed. Also you need to separete selector pair with comma. "field=value1,field2=value=2".
  24. Ended up posting? They're moderated so they won't get published immediately.
×
×
  • Create New...