-
Posts
5,039 -
Joined
-
Days Won
340
Everything posted by Robin S
-
In the module info for a Process module you can include settings that automatically create a page under Admin: // page that you want created to execute this module 'page' => array( 'name' => 'helloworld', 'parent' => 'setup', 'title' => 'Hello World' ), Is there an easy way to make this created page hidden so it doesn't appear in the admin menus? Or if I need a hidden page would I have to create/remove the page in the install()/uninstall() methods? Edit: should have guessed it would be so easy... // page that you want created to execute this module 'page' => array( 'name' => 'helloworld', 'parent' => 'setup', 'title' => 'Hello World', 'status' => 'hidden', ),
-
- 5
-
-
Thanks, fixed in latest commit.
-
You would enable URL segments on the template used for "Shirts" and "Shoes". You would allow segments that match the names of your category pages and throw a 404 for anything else. For example: if($input->urlSegment1) { $category_names = $pages->find('template=category')->explode('name'); if(in_array($input->urlSegment1, $category_names)) { // build your selector to filter the products using $input->urlSegment1 } else { throw new Wire404Exception(); } } else { // show all the products }
- 5 replies
-
- 2
-
-
- categories
- menus
-
(and 2 more)
Tagged with:
-
You can use URL segments for the category name. Or a GET variable - the principle is the same but the URL segments are nicer. Look for the URL segment in your template and then use it in a selector for your product pages. If you read through Ryan's URL segments tutorial you should get the gist of it. Make your navigation links by iterating over the category options, or if you want to get fancy, just the categories that are used by products in that section.
- 5 replies
-
- categories
- menus
-
(and 2 more)
Tagged with:
-
I'm looking forward to client-side image resizing in PW. I have clients who will upload massive 24-megapixel 10MB images without a second thought. I use the "Max width for uploaded images" option but it's not working reliably because the oversized images still get through somehow (perhaps out-of-memory issues). Anyway, I was looking for a foolproof way for non-tech-savvy clients to resize images and found this: https://bulkresizephotos.com/ Images are resized client-side so it's much faster than many of the other online tools. You can resize multiple images at once and get a ZIP file back with the results. And the best feature is that you can set the tool up how you want and then generate an embeddable drag-and-drop widget, so it's super-easy for clients to use and there are no options for them to mess up. I created a Hanna Code for the widget and added it to the online documentation I supply to clients so it's right there when they need it. Could even potentially be embedded directly in the admin theme. Until client-side resizing comes to PW this is a useful stopgap.
- 4 replies
-
- 12
-
-
Just count yourself lucky and stop your research now. Trust me, you're not missing much. But seriously, this is what I'm talking about. There's got to be a reason why Germany is the only country whose interest in PW reaches the threshold to register on Google Trends - any ideas?
-
Perfect, don't know how I missed that. Is this because the parentheses are needed as a kind of delimiter when looking for the /*NoCompile*/ comment? I often see parentheses used with include but thought that was a personal preference of the coder - like, you could use parentheses with echo if you wanted but it's not necessary. The PHP docs say that parentheses are not needed with include/include_once/require/require_once, and they are not used in the code examples there.
-
I am testing using: FileCompiler=? With dot syntax the /*NoCompile*/ comment works, but not without. include "./test_include.php" /*NoCompile*/; // included file is not compiled include "test_include.php" /*NoCompile*/; // included file is compiled
-
Another week, another set of useful updates. It would be good if there was a URL option to return the complete URL of the current page, including URL segments and page numbers. Earlier in the year I was looking for such a feature and had to do this: $full_url = $page->url; if($input->urlSegmentsStr) { $full_url .= $input->urlSegmentsStr . "/"; } if($input->pageNum > 1) { $full_url .= $config->pageNumUrlPrefix . $input->pageNum; } Regarding the /*NoCompile*/ comment, it seems it doesn't work if the include statement uses a relative path without any dot syntax (which may not be best practice but is still valid). So for an included file in the same directory... include "test_include.php" /*NoCompile*/; ...the included file is still compiled.
-
Conditionally alter column width in template admin view (?)
Robin S replied to LimeWub's topic in General Support
Yes, that's right. Repeater Matrix can be useful when you want to structure your page as a series of blocks of different types that the editor can add and sort as needed. -
When you create forms using the core Inputfield modules then you are using the same methods as used for the PW admin interface. If you're seeing something different in the admin than in your frontend (e.g. width of textareas) then use your browser dev tools to check the CSS that is applied in the admin. There you'll see that textareas have a width: 100% rule, so that the final width of the element can be controlled by the <li> wrapper (which can have its width style set inline via columnWidth).
-
Interesting, thanks. The purpose of the site is also a bit mysterious. The docs read like a "how to use" but there doesn't seem to be any download link. Do you think it's intended to be distributed (sold?) or just for demonstrating what is possible with PW?
-
I'm really curious. Someone has put a lot of work into that. Domain gives no clues as WHOIS data is anonymised.
-
Conditionally alter column width in template admin view (?)
Robin S replied to LimeWub's topic in General Support
Sounds like a job for Repeater Matrix. -
Not sure that you need to do the first pipe replace - you could just explode on commas and then trim(). You'll add the pipe when you implode. Also, passing by reference in a foreach can catch you out so perhaps better to avoid it. // Explode search input into array $search = explode(",", $input->get->search); // Sanitize each value foreach($search as $key => $value) { $search[$key] = $sanitizer->selectorValue(trim($value)); } But otherwise it looks fine to me; that's what I would do.
-
Hi @mmc, welcome to the forums. It strikes me as unusual to use CKEditor in a contact form - I don't think I've ever seen a contact form that invites the visitor to submit their message using an RTE. A plain textarea is more typical. But anyway... For width you can set the inputfield columnWidth property: $field->columnWidth = 25; // sets width to 25% Or you can just set the width of the element that contains CKEditor in your CSS. For height, InputfieldCKEditor extends the InputfieldTextarea class so you can use the rows property: $field->rows = 3;
-
This is very cool. Both the module and the bundled actions will be super useful. Thanks!
-
Just adding Ryan's answer from the Github issue for future reference:
-
I expect this wouldn't suit because you want the separate $bookings variable for doing other things with, but just wanted to add that you can get to an array of room data in a single query: $roomsData = $pages->find("date=$today, parent.room=roomOne"); // you'd probably limit by template here too
-
@elabx, the unformatted value of an images field is always a WireArray. Having the value be a Pageimage for a single image field is the result of output formatting. I think what Soma is saying above is that output formatting is off when you bootstrap the PW index.php. So the issue doesn't occur because of an AJAX call, it occurs because of the bootstrapping. So solutions would be either: Just be aware that output formatting is off when bootstrapping PW and adjust your code accordingly In your AJAX call, load a normal PW page rather than a PHP file that bootstraps index.php
-
I believe that each time you call $pages->find() or $page->find() the PageFinder class is used to query the database. If you're wanting to analyse performance in detail then Profiler Pro in the new ProDevTools would probably be money well spent. Besides the tool itself there is this benefit:
-
This is trivial, but the template edit link in the Page List hover actions is 1 pixel lower than the other actions. Same in Chrome and Firefox.
-
When editing field settings (Setup > Fields > my_field) I'm seeing an error: PHP Notice: Trying to get property of non-object in ...\modules\AdminOnSteroids\AdminOnSteroids.module:1224 BTW, thanks for making this configurable: