Jump to content

kongondo

PW-Moderators
  • Posts

    7,487
  • Joined

  • Last visited

  • Days Won

    147

Everything posted by kongondo

  1. "process to assign....": This tells me you are assigning your 'settings' page the 'wrong' template. Do not assign it the admin template. 1. First create your own template (no need for a template file; just the template). Call that template, say 'settings'. 2. Add the fields you want to that template. 3. Go to Admin (I mean the page Admin in the page tree), create a new page under the 'admin' page. Call it 'settings', give it the template 'settings'....you are good to go.. .... Pages under admin can only be seen by the 'supersuser' - so, no worries that people with the wrong permissions will see it . In addition, as I stated, these pages cannot be directly accessed via the frontend + your page will not have a template file....(not that it matters since this is an 'admin' page). Have you read up on the docs about how PW works? If not, you might want to do that first
  2. Hi Madalin, Welcome to ProcessWire and the forums! There are a number of ways to achieve this. If it is only a settings page, then you can create the page as a direct child of Admin. I don't know what you mean by "to show as tab with some functionality" but the page should show up as a menu item in Admin. You will need to have a template for that page, of course. Add as many fields as you want to that template that will be used by your "settings" page. You can then pull up data from that page using the PW API, in this case you would want to use $pages since pages in Admin cannot be accessed directly in the frontend (so no $page). To output your settings fields...example.. echo $pages->get(12345)->title//Here, 12345 is the ID of your settings page. You can also retrieve the page by its path or title or name... Have a read here http://processwire.com/api/variables/pages/ http://processwire.com/api/variables/page/
  3. Or if you are lazy like me... This should work as well, I think... $session->redirect($page->child()->url); In some cases, can be a good idea to first check if page actually has children ... if($page->numChildren) $session->redirect($page->child()->url) Oh, and welcome to PW! Edited: corrected code, etc...
  4. ....nothing to see here, run along, ta ta...
  5. Cool first post @carrdesigns! Welcome to the forums!
  6. Yes...use what is best for the job. $sanitizer->name is best for ProcessWire 'name' - Name is used to build the URL hence its formatting (of course you can use it if you require such formatting...) but in your case, text should be fine...
  7. Sorry, my bad. I misunderstood...Try this instead,, $p = $this->modules->get('ProcessPageList'); $p->set('id',2480); // the parent page return $p->execute();
  8. $p = $this->modules->get('InputfieldPageListSelect'); $p->attr('name', 'products');//example name value for selected page //$p->set('parent_id', $parentId);//here we set the parent whose children will be selectable OR $p->set('parent_id', 12345);//here we set the parent whose children will be selectable $p->set('startLabel', $this->_('Product Blah Blah')); You can even change the 'more' and 'cancel' labels...
  9. Nice to see this is coming along nicely Valery. Be warned though, Process Modules are addictive!
  10. Or you can use the search box on the cheatsheet page...
  11. Thanks to Soma, we have this: http://cheatsheet.processwire.com/
  12. echo $page->createdUser->name; Adrian beat me to it...OK, so am slow...nothing new there
  13. I use Sublime mainly, but also use Np++ sometimes. PHP strings of HTML are highlighted just fine. Better if you concatenate variables within the strings (if any) rather than use curly braces..i.e. Rather than.... "My string is about {$page->title} and other stuff"; use this.. "My string is about" . $page->title . "and other stuff";
  14. Hey Franko...welcome to ProcessWire and the forums! I don't know why, but I had a feeling you were coming in from MODx...been happening a lot lately...Anyway, enjoy!
  15. Patiently waiting for Windows version .. ;-)
  16. ? U forgot to ask your question?
  17. .....sometimes the API works just as well
  18. A minor (but crucial) typo on second version; should be $wire->page
  19. I'm jealous! Glad you guys had a nice time
  20. joe_ma. I like your tenacity! Sorry to see you are still struggling with this. Not a direct answer to your query, but I would like to suggest debugging your code 1 step at a time can help you find where the error is coming from; it is also fun and will make you a better coder in the long run. That's what I learnt from the gurus here ... You could do something like this: $events = $pages->find("template=repeater_time_loc, check_access=0"); //get all the repeaters with event information echo gettype($events) . '<br>';//this will tell you the type of variable you are dealing with [just an example] //if it is an object/array... echo '<pre>'; echo print_r($events);//verify $events is returning what you were expecting echo '</pre>'; exit;//stop other code executing Keep on doing this or similar line by line, Check even inside the foreach (e.g. print_r($days)) to verify things are being returned as expected, exiting after short lines of code, until the next variable, etc, etc.. Were you expecting an integer? Was a string returned instead? etc...This way, you will be able to (hopefully) identify where things are going wrong. Make sure debug is turned on as well.. Anyway, just thought to share my experience....
  21. By crop image field, do you mean you are using the cropImage module? You can use a normal image field for your Avatars. You interact with that image field like any other image field..only this time you are dealing with the 'user' template. Also remember that in the DB 'users' are stored as 'pages' so, similar API syntax... See this post by Ryan: https://processwire.com/talk/topic/10-how-do-i-interact-with-the-image-field-in-processwire/ and the docs https://processwire.com/api/fieldtypes/images/ Btw, do you need a profile image to be that big?
  22. Manaus, Not sure what your App does or its design, but I'm not getting why you need to store IDs (basically integers) using JSON? Can't these be stored as comma separated values? If you want to go the JSON route, there's various threads on the forums you can have a look at (Google )
  23. In that case, one way is to only allow them to delete the pages that they have created. I'll let others more knowledgeable chime in here The property $page->createdUser will get you the user In a selector you can search using created_users_id
  24. If many users can be assigned the role frontend_editor, then it means you need to go further in your checks. Is there a maximum number of pages each user can create? Is there a limit to the number of users? Answers to these questions will help determine the approach needed to control access - e.g. for a site with 100K users, controlling access by giving them individual templates may not be very workable.... Just loud musings here..
×
×
  • Create New...