suntrop

Members
  • Content count

    168
  • Joined

  • Last visited

Community Reputation

28 Excellent

1 Follower

About suntrop

  • Rank
    Sr. Member

Profile Information

  • Gender
    Not Telling
  • Location
    Germany, Cologne

Recent Profile Visitors

2,951 profile views
  1. That is great! Many thanks.
  2. I had added the title filed to the roles template. And I found I can configure the roles module to display other fields in the listing under Access > Roles – but currently I found no way to display the title instead the name on the user profile pages.
  3. On the user-edit page for example
  4. I would like to use the label for roles, as the label is used for templates. My role names are more technical and in englisch, but I would like to give them a more readable and lengthier name. When I edit the "role" template there is no field "templateLabel" I can add.
  5. I thought there is some hidden config and an easy step. Seems there is no option at all https://github.com/processwire/processwire/blob/master/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module#L978 @adrian I am using labels, because template files are in Englisch, but my clients prefer a more eligible, German name. Will have a look tomorrow
  6. Yes, I am talking about the settings tab, so after the page is saved or for existing pages. The dropdown list is about 20 entries long and it is pretty hard to find the exact template you're looking for, because there is naturally no order. That is bad usability and I want it to sort in an alphabetically order to make it easier finding a template. The exact same use case goes for excluding templates that make no sense for the editor (like templates just for settings or "admin" pages, etc.).
  7. On the Settings-Tab you can select the template of a page. Two questions: How do I change the order of them? Currently it looks very messy and I would like to sort it alphabetically How do I exclude certain templates from this list? I couldn't find a system field for it and have looked at other field configs, but noting helped. I've got some pages I don't want my client to be selectable. I have set "Can this template be used for new pages?" to no, but that doesn't work.
  8. Well, ok ... Thanks. But I was asking specifically for Procache
  9. Hi. I have some questions about ProCache. Is it possible to exclude certain pages (by URL, template, page?) from being cached? … or in reverse – just make pages within a section of my website being cached? Is there something I need to change in my templates or is it more like a "click-and-go" plugin? (basic caching, no assets manipulation) What about pages with dynamic generated content (like flash messages, integrated RSS feeds, number of items in cart, etc.) I have two sites in mind, and one is a shop. So I am wondering if ProCache is suitable for it. If a user puts something into his cart, the cached page can't be the same static HTML page for the other users.
  10. Thanks for your quick help. Since I need to import the CSV via API, I wouldn't just trust the backend/JS. Other parts (like password, I think) don't match the UI rules. And I need to create other related pages and more in the same run. Anyway, your module is on my list Thanks!
  11. I need to import a list of users my client sends me. He wants to know what rules make a valid username. Sounds easy, but I need to make it bulletproof, when I tell my client, because he sends a lot of print letters with those usernames When I look at the name (aka username) filed it says: Any combination of letters (a-z), numbers (0-9), dashes or underscores (no spaces). As I think, those are pagenames and thus the sanitizer->pageName() is applied? This one says something different: Page names by default support lowercase ASCII letters, digits, underscore, hyphen and period. Usernames with periods apparently are ok. ASCII letters, however, sounds a bit ambiguous. @ or $ is in some manner a letter too. Perhaps I am wrong, but haven't studied english linguistic And I think it only counts for the 128-ASCII table, not the extended one. Seriously, I don't want to make it more complicated than it needs to be, but the docs made me think of it. Thanks!
  12. HI all. I recently built a web shop with PW and it works pretty good. I love the simplicity and freedom working with templates and how stuff works and the client loves the back-end. However, the part I am unhappy about is the site search. Beside the API selectors work fine, it seems not be suitable for that kind of search. People search for words, phrases, they mix spaces, hyphens etc., add measurements … so a lot of searches end up in 0 results. I know of the ElasticSearch module and other external things like Sphider, Google CSE, algolia.com … but some are quite complicated and limit my control or bring google's ads on the site So perhaps you have any improvements, ideas how to get a better search engine on my website. Most problems come from spelling issues, singular/plural, hyphenated words/searches. <?php $vars['q'] = $q; $input->whitelist('q', $q); $q = $sanitizer->selectorValue($q); // 1. // Item Number // If there is a number in it that matches a product's numbers, redirect to product directly $q_numeric = preg_replace('/\D/', '', $q); $prodcut_item_number = $pages->get("template=product|product_variation, product_item_number=$q_numeric"); if ( $prodcut_item_number->id && $prodcut_item_number->template == 'product') { $session->redirect($prodcut_item_number->url); die(); } elseif ( $prodcut_item_number->id && $prodcut_item_number->template == 'product_variation') { // variations are saved as sub-pages, but have no public web-page $session->redirect($prodcut_item_number->parent->url); die(); } // 2. // Product title and description // Search the product's title, headline and summary $matches = $pages->find("title|headline|summary~=$q, template=product, limit=50"); // 3. // Categories // If search is a category, append all its products $categories = $pages->find("title%=$q, template=category, limit=10"); if ( count($categories) ) { $category_ids = $categories->each('id'); $category_ids = implode('|', $category_ids); $append_products_from_category = $pages->find("template=product, has_parent={$cat_ids}"); $matches->append($append_products_from_category); } // 4. // Split search phrase // If nothing above matches, try each word separatly if( !count($matches) ) { $q_separate = preg_replace('/\PL/u', ' ', $q); // "Remove" everything but letters $q_separate = preg_split('/\s+/', $q_separate); foreach ($q_separate as $q_word) { if ( $q_word != '' && strlen($q_word) > 4 ) { $append_products_separate = $pages->find("title|headline|summary~=$q_word, template=product, limit=50"); $matches->append($append_products_separate); } } } // PLEASE NOTE – this doesn't come from my production code, but is a current idea I have // There is no highly need of weighting results and order best results on top, because there are just a few products for each keyword :-)
  13. That's right, a regular array will survive the redirect.
  14. Hi all. Perhaps this is just my fault, but I can't get behind it :-( When I store an array in a $session and want to read its contents – after a $session->redirect() – it is NULL by var_dump() If I use the exact same code and just store a string or a Page ID the output is correct. // file-1, product page $last_add_to_cart['product'] = $selected_product; $last_add_to_cart['quantity'] = $selected_product_quantity; $session->last_add_to_cart = $last_add_to_cart; $session->redirect('/warenkorb/'); // file-2, cart var_dump($session->last_add_to_cart); // is NULL Strangely this works // file-1, product page $last_add_to_cart['product'] = $selected_product->id; #$last_add_to_cart['quantity'] = $selected_product_quantity; $session->last_add_to_cart = $last_add_to_cart; $session->redirect('/warenkorb/'); // file-2, cart var_dump($session->last_add_to_cart); // is 1234 EDIT: When I var_dump the $session before the redirect everything is ok
  15. Thanks guys! I used Batcher before, but I really have to have a closer look at Adrian's module.