Jump to content

Tom.

Members
  • Posts

    461
  • Joined

  • Last visited

  • Days Won

    7

Community Answers

  1. Tom.'s post in Is PW right for this project was marked as the answer   
    Hi am*,
    Welcome to the forum, you will find that ProcessWire is called a CMF over a CMS and for very good reason, it's incredibly flexible. There is nothing you mention which stands out of the ordinary. ProcessWire has been used from everything to simple one pages to Project Management Systems, and it performs extremely well in all walks of (development) life.
    I would encourage you to check out the new documentation https://processwire.com/api/ref/ 
    Updating fields such as if someone becomes a paying user, it's incredibly easy:
    $user->of(false); $user->addRole('member'); $user->save(); One thing to remember in ProcessWire is everything is a page, this means the API is incredibly simple not matter what you want to do, as the syntax is completely the same across all different types of pages. 
  2. Tom.'s post in make visit counter code count once per session was marked as the answer   
    This is because you are setting the session to 0 every time the page loads, the reason it's working if you are logged in is because of the $user->isLoggedin().
    You don't need anything else other than:
    if($session->get('visit_counter_flag') === 0 && !$user->isLoggedin()) { /* if the user is NOT logged in and not counted */ /* turn of output formating so PW do not give an error when we change the value */ $page->of(false); /* increment the current integer plus one */ $page->visit_counter++; /* save the visitor_counter field */ $page->save('visit_counter'); /* turn on output formating so PW work as it should */ $page->of(true); /* set a visit counter flag to 1 so next load do not count */ $session->set('visit_counter_flag', 1); }
  3. Tom.'s post in Pagination issue with three different queries on one template was marked as the answer   
    Hi Richard,
    Have you tried the following: http://snippi.com/s/bnx7cij
  4. Tom.'s post in Strange behaviour with $session was marked as the answer   
    Just an update for anyone who may hit this issue in future. Wrapping your $session in an the following if statement works.
    $(!$config->ajax) { } It's because the front-end editing when activated reloads the page using ajax. More on it here: https://github.com/ryancramerdesign/ProcessWire/issues/1602#issuecomment-172309783 - Thanks Ryan for clearing it up.
  5. Tom.'s post in Sort Array Question was marked as the answer   
    I didn't manage to figure out the reason behind the duplication. However as always ProcessWire saves the day. I thought the sort function only worked with fields set in the database. However I thought I'd just try it:
    $results->sort("distance"); works perfectly. Ryan you're a God. 
  6. Tom.'s post in Getting blog content from childs child was marked as the answer   
    Inside that foreach, add another using $news->children as $news. I would give a better code example, but I'm on my mobile.
    Sorry, I can't find the edit button on the mobile site. But I just noticed you aren't echoing out your title you need to use <?=$news->title?>
  7. Tom.'s post in problems echoing arrays was marked as the answer   
    Try:
    echo $slider->eq(0)->images->frist()->url;
  8. Tom.'s post in Error: Exception: SQLSTATE[42S22] with search.php was marked as the answer   
    Hello,
    This has been fixed on GitHub, re-download the version you are using and replace the wire folder (Remember to backup)
  9. Tom.'s post in [SOLVED] Hidden page is not accessible to guest user, how to fix this? was marked as the answer   
    This is a little out of my technical know-how so I'm completely guessing here, but I would say the reason the html isn't printing is because you have set the content-type of the document to application/javascript or application/json. 
    Also $users is a variable that should only be used in context to the ProcessWire API. http://cheatsheet.processwire.com/ 
    You don't need $users = $pages->find() ... foreach($users as $u) should just work on it's own.  
  10. Tom.'s post in Wow... Processwire seems to be the CMS I have always wanted.. was marked as the answer   
    Welcome aboard,
    1. We have plenty of converts here. Myself I'm a WordPress convert. However I'm not a convert from MODX so I will not be able to tell you the differences.
    2. ProcessWire does not alter any of your markup and only when using ->render() will you find it output markup. With the new front-end editing it does alter your markup but only when logged in with the permission to edit using the front-end. The HTML, CSS and Javascript is completely down to you. By default ProcessWire uses PHP as it's template engine. So the only thing you need to learn is API and that's it Oh yeah, and the API is super easy to learn. Trust me ProcessWire is a front-end developers dream. 
    3. I work at an agency but also freelance. While I don't charge much at all for freelancing as my job is my hobby. ProcessWire is always my CMS of choice. So I guess you can say I make a living out of ProcessWire. 
  11. Tom.'s post in style part of an array was marked as the answer   
    <?php foreach($page->children as $child) {     echo "<div class='my-class'>";     foreach($child->images as $image) { echo "<img src='$image->url'/>"; }     echo "</div>"; } ?>
  12. Tom.'s post in Page Tree not visible in Backend after Installation was marked as the answer   
    I believe it's hidden by default because "Pages" also took you to the page tree. This means on the default theme you have Pages and Pages > Tree going to the same place. I can see how Ryan saw this as confusing for non-technical users. 
    However with Reno Theme you can't single click on the top level menu item, causing this problem. You can double click Pages to get to the tree, however I recommended: https://processwire.com/talk/topic/7625-reno-theme/?p=108089
  13. Tom.'s post in echo $child->body was marked as the answer   
    <?php  foreach ($page->children as $child): echo "<div class='my-class-$child->id'> $child->body"; endforeach; ?> echo doesn't need (), this should also give each instance a unique class if you are looking for that
  14. Tom.'s post in unable to add <i> tag in body field was marked as the answer   
    This isn't a solution to your problem, however why not use hanna-code? [[icon i=check-circle-o]] <- something like that? Look at the module hanna code
    https://processwire.com/talk/topic/3745-hanna-code/
×
×
  • Create New...