Jump to content

Wanze

PW-Moderators
  • Posts

    1,116
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Wanze

  1. Just had the same problem with the teflon theme (v2) from Soma. The strange thing is that the button does work when editing pages, but not when editing users.. Have no time to investigate right now. Edit: Ah and it's newest Chrome, not IE
  2. If I remember correctly, there's a module somewhere from Nico which allows you to edit templates in the Pw backend. Should be easy to modify and add the functionality for creating a new file too.
  3. Do you mean in terms of SEO? If you don't need to show "Products" in the navigation, just skip the page when building the navigation - this way it'll show up in your sitemap but not in the navigation. Sorry, I'm not sure if I understand the problem exactly
  4. This is very dangerous from a security point of view. Never store information coming from the user directly in the session without sanitizing and validating first. Plus, only store necessary informations, for example the e-mail or user-ID. Example: A bad guy can now alter the post data and include 10'000'000'000 new variables which you try to store in a file on the server. Maybe your server crashes Do you use ProcessWire users for the registrated users? I don't understand why you need to store stuff from a post request into the session. I mean, after the registration your system somehow needs to be able to log in users. And if a user is logged in without the "payed" flag, you show the link to PayPal. But in this case you already have a valid session for the user...? The first is true, because "normally" cookies get deleted by clearing the browser. But when leaving a page or closing the tab, the session remains. How long a session is valid, is defined in your php.ini.
  5. You can open the page under /admin/ (in your site tree) and check if there's a Process selected, or add the right one if the field is empty.
  6. Almost If there is a page found, a Page object is returned, which always has an id > 0. If there is no page found, a NullPage object is returned, which always has the id = 0. the id is either equal to zero or greater, but never empty.
  7. Change your if to: if ($fwd->id) { //... } Because if there's no page found, Pw returns a NullPage object (with id=0). Your current if is always true, because $fwd is an object. Edit: nik 1, wanze 0
  8. If your course template has the fields "title|body|sidebar", they should be searched too. If these "sub-pages" are hidden, you need to add "include=hidden" to your selector string. For the results: foreach($matches as $m) { $outMain .= "<li>" $url = ($m->template == 'course') ? $m->parent->url : $m->url; $title = ($m->template == 'course') ? $m->parent->title : $m->title; <h2 class=\"h4\"><a href='{$url}'>{$title}</a></h2> </li>"; } Note that the parent page may be listed multiple times with this code.
  9. Hi Tyssen, Each page in ProcessWire has its own (unique) url. What do you mean with child-pages? Can you give an example how those pages are integrated in a parent page? Cheers
  10. You should not modify files in the /core/ directory - they get lost when updating Pw Go to Setup > Fields > your_field > Input > TinyMce Advanced Configuration There you can set your style attribute to valid elements.
  11. Hi RJay Each page in ProcessWire has a unique path - this one is solved. As for the digits, you can enter some in the page name. To add for example the creation date of the article automatically to the name field, you could use a hook that hooks after saving the page, then modifies the name attribute.
  12. In the model view of page edit (append &modal=1 to the URL), the save button is placed inside the first field. Maybe a bit more space there would be nice
  13. Did you try a fresh install of the theme? It's working fine here, on OS X Mavericks and Chrome vs. 30.0.1599.101 Good Luck!
  14. Sorry, I meant that I'm using the second (newer) version of it. I thought it was called version 2, but I think that's not true The version I'm using is on the dev branch: https://github.com/somatonic/teflon-admin-theme-pw2/tree/dev It's a bit different than the one on the master version, but I think both themes should work on the stable 2.3.0 of Pw. I'll do a quick test here locally. Btw are you seeing any javascript errors in your console? Or files that are not loaded properly?
  15. Which version of Pw and Chrome and Teflon? I'm using latest chrome on mac os x with the teflon v.2 theme and Pw dev - works great.
  16. https://drupal.org/node/1367802 With "localserver" you probably mean "localhost"? You've never installed ProcessWire and think that it is as heavy as Wordpress? Please Try install it locally first. And maybe change the hosting, because google tells that other OS systems have problems too with ipage (see drupal link). Cheers
  17. If the template where the pdf's are stored is not viewable by the guest role, then you can set $config->pageFileSecure to true. Then only roles that have view permission to the template are able to access the files directly.
  18. Hi darrenc, Your project sounds perfect for Pw (and vice versa ). For the site-structure: I suggest to look at kongondo's excellent tutorial here: http://processwire.com/talk/topic/3579-tutorial-approaches-to-categorising-site-content/ Bookmarking: I would just store the ids of the products a visitor has bookmarked in the session. On the review-page, display them together with a form and send the data to the client afterwards. Some pseudo code: // in template product // .... // Check if this product was bookmarked, e.g. on top of the product template if ($bookmark = $input->get->bookmark) { $bookmarks = ($session->bookmarks) ? $session->bookmarks : array(); $bookmarks[] = (int) $bookmark; $session->bookmarks = $bookmarks; } // this is the link to bookmark the actual product <a href='<?= $page->url; ?>?bookmark=<?= $page->id; ?>'>Bookmark me!</a> // in template review if (count($session->bookmarks)) { foreach ($session->bookmarks as $b) { echo 'You bookmarked ' . $b->title; } } else { echo 'no bookmarks'; }
  19. If I understand your needs correctly, I don't think you need hooks. The 404 page has a separate template, so you could move your logic there: $uri = $_SERVER["REQUEST_URI"]; if ($uri == 'hello') { echo 'hello'; } else { echo 'not welcome'; }
  20. You could increase the number of pages showed in the ProcessPageList module settings. The problem is that when having lots of data, it's usually not a good idea to let the people manually sort the pages. Normally, you'd define a sort field.
  21. Well in this case you should add two separate fields in the search: author and title. Because you can't know which words belong to authors or titles if there are multiple in the search string.
  22. I'm not sure if I get the problem. But depending on the amount of data, you could quickly loop through and remove invalid items. However, this may introduce problems with the paging, if you use it: $results = $pages->find("your selector and then only, age_min<=$value"); foreach ($results as $result) { if (!$result->age_max) $result->age_max = 99; if ($value > $result->age_max) { $results->remove($result); } }
  23. you need so specify also what field you want to search in your selector. Also there exists $pages->count() which is faster than a find, if you don't need any values: if ($pages->count('title=asd@asd.pl')) { echo 'error'; } In your code, I noticed that you set the email addy also as page name, but for example an '@' is not supported there. You can omit setting the name and Pw will generate it for you based on the title. But if you set it yourself, then use $sanitizer->pageName(): $email = $form->get('email')->value; $p->title = $email; $p->name = $sanitizer->pageName($email); // Or delete this line... $pageName = $p->name; // What are you doing here? $name = $pageName; // And here? $p->save(); Cheers
  24. I'm not sure I understand fully: With your qp_enqueue_script function, how do you solve the problem of loading a script only for a specific page? I think you still need an additional if? // Only load script for Page with name 'pw-rocks' if ($page->name == 'pw-rocks') $config->scripts->add('blub.js');
  25. You can code the redirect yourself instead setting it in the templates access settings: if (!$user->isLoggedIn()) { $session->redirect($pages->get('/login/')->url . '?message=' . (int)$input->get->message); } Or store the message ID in a session variable and read it out on your login page. (Code not tested... )
×
×
  • Create New...