-
Posts
10,912 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
No issues here on Mac Chrome - maybe teppo is just having a bad day
-
Problem with multiple foreach statements...
adrian replied to PhotoWebMax's topic in General Support
You can add: include=hidden to the selector in your foreach. -
Hi Ralf, Glad you are enjoying using it. I just tested it with: and it works fine for me. See attached screenshot Can you see anything different that you think might be affecting things?
-
We're going to need more than that to help you Any errors with debug mode on? Post your final code so we can a look.
-
Module: AIOM+ (All In One Minify) for CSS, LESS, JS and HTML
adrian replied to David Karich's topic in Modules/Plugins
Thanks for the explanation. I am sure you've seen it, but this looks promising: https://github.com/tedivm/JShrink Anyway, thanks again for this module - it's a real time saver. On an unrelated note - I did notice something yesterday when using the loadOn option. It worked fine for CSS, but it didn't seem to work properly with JS. Before you go delving too deep, I should do some more testing and see what I can find - might have been an issue at my end. I'll try again soon and let you know how it goes. -
Soma, I think he is talking about this setting: https://github.com/somatonic/ImagesManager/blob/master/ImagesManager.module#L36
-
Thanks for cleaning things up, although you might have gone too far - now we don't know where $u comes from Actually with it cleaner I did notice something new - your check for: if (count($u->avatar)){ If you want to go with the count approach don't you want it to be: if (count($u->avatar) == 0){ since you are trying to find a case when there is no avatar? Of course I think you should be using $user->avatar directly, but you get what I am saying.
-
Have a read of this: https://processwire.com/talk/topic/2194-flie-upload-max-file-size/ It should help you with your php.ini settings.
-
Hi Cairan and welcome to PW. Of course: <img src="{$child->nav_image->url}" /> Although depending on your image settings, you may need to use: $child->nav_image->first()->url Have a read of: http://processwire.com/api/fieldtypes/images/
-
Module: AIOM+ (All In One Minify) for CSS, LESS, JS and HTML
adrian replied to David Karich's topic in Modules/Plugins
Hi David, Thanks again for a great module. Just wondering if you did any experimenting with other js minification libraries? I am no expert on this, but noticed that I can get significantly smaller files (in one case 400kb down to 300kb) by minifying using http://jscompress.com/ I know that runs on nodejs, but there are other php alternatives out there, although maybe none of them are any better. Maybe you've already been through this process and decided JSMin is the best option, but just thought I'd ask -
What about this: $results = $page->children("limit=2, sort=-date");
- 6 replies
-
- Pagination
- url
-
(and 3 more)
Tagged with:
-
Ok, well you have the allow pagination on the correct template now which is good. I don't really ever use render() for generating page content, so I might be off here, but try this: foreach($results as $result){ echo $result->title . '<br />'; }
- 6 replies
-
- Pagination
- url
-
(and 3 more)
Tagged with:
-
I don't understand why you are doing this: $u = $users->get($user); if (count($u->avatar)){ You have already done a foreach: foreach($user->avatar as $image) { to define $large and $thumb Think about this vs using first() if the avatar field can contain more than one image (although makes sense to set it to one in this scenario I would think). Keep in mind that right now you'd be re-setting the $large and $thumb for each image if there was more than one. But the key thing is that you can check if they are set for your if/else statement. if (!isset($thumb)){ $avatar_thumb .= "this is a test"; } else { $avatar_thumb .= "<img class='img-rounded img-responsive' src='{$thumb->url}'' alt='{$thumb->description}'' />"; } Oh, and definitely try to follow Martijn's suggestion of making your code better formatted before posting, as well as trying to reduce it down to just where the problem is - I know this can sometimes be difficult but it does make it look less overwhelming for those considering helping.
-
Do you have "Allow Page Numbers" turned on for the template? Have you tried: foreach($results as $result){ echo $result->render(); }
- 6 replies
-
- Pagination
- url
-
(and 3 more)
Tagged with:
-
@horst - great job on this - I will try to test soon. One thing I just noticed is that singular is still set to false in the version posted to Github.
-
[SOLVED] LESS CSS on Server without Node.js.................anyone?
adrian replied to Vineet Sawant's topic in Dev Talk
You could also make use of the PW AIOM module: http://modules.processwire.com/modules/all-in-one-minify/ which compiles less on the server automatically. -
This is what I have based my front-end logins off and all work great: https://processwire.com/talk/topic/1716-integrating-a-member-visitor-login-form/?p=15919
-
@isellsoap - I am not a formbuilder user so not sure if this is a bug or not, but your best chance of getting a speedy replay from Ryan is to post this in the Formbuilder support area: https://processwire.com/talk/forum/18-form-builder-support/ If you don't have access to board, you should PM Ryan and ask for access.
-
ProcessWire on Windows7/2008 Server with IIS WebServer
adrian replied to nikola's topic in General Support
Have you read and followed the instructions in post #8 above? Particularly the bit about "Error 404 file or folder". It sounds like you need to download and install a separate url rewrite module. Hope that helps? -
Repeaters: sorting input fields; listing according to input fields
adrian replied to joe_ma's topic in Getting Started
The clue is in the array keys - see how there are lots of the same numbers? Your $days = array(); is inside the $programm loop so it is getting reset each time. Also you are outputting the results inside the $programm loop. Try this. Untested, but I think it should be right. $programm = $pages->find("template=event"); //find all pages with events $days = array(); // array for dates - defined once at the start foreach ($programm as $p) { $events = $p->time_loc; //find the repeater fields foreach ($events as $event) { $days[]= date("l, d. M Y",$event->getUnformatted("date")); //fill the dates array with the dates from the repeater } } //close programm loop $day = array_unique($days); // eliminate duplicate dates asort($day); foreach($day as $key => $d) { echo "<p>$key = $d</p>"; } -
Repeaters: sorting input fields; listing according to input fields
adrian replied to joe_ma's topic in Getting Started
$program = $pages->find will return an array of pages so you need to foreach through that as well. -
In a bit of a rush, but ->get will only ever return one page. You need ->find if you want to get all pages with parent=/products/ So maybe: $all_pages = $pages->find("parent=/products/"); foreach($all_pages as $p){ $p->of(false); $i=0; foreach($p->prod_image as $image){ //if($i!=0) $p->images->delete($image); if($i!=0){ echo $image . " selected to delete<br />"; } $i++; } } Note - really rushed and untested, but hopefully you get the idea.
-
Prevent users to delete pages with certain templates
adrian replied to juhis's topic in General Support
What I do is define a role called "deletor" with permissions to view, edit. and delete. Then for the appropriate templates give the deletor role the ability to edit the page. For those templates that should be edit only, only check edit for the editor role, not the deletor role as well. Does that make sense? -
-
As Ryan states: "The info field (in the page editor settings tab) is currently specific to server time and not affected by timezone settings." https://processwire.com/talk/topic/2846-timezone/?p=38793