-
Posts
11,112 -
Joined
-
Last visited
-
Days Won
365
Everything posted by adrian
-
@hellomoto Can you please check your phpinfo (via Tracy if you have it) and let me know if tokenizer is enabled.
-
Yes you can, but generally there is no need to have more than one unless they are on the same template. You can use template context overrides - click on a field name in the template view (showing all fields) and set the label and other details there and these will only be for that template.
-
The label is what the user sees when they are editing the page in the admin, so it's very useful. You can rename the field from "images" to "myphoto", but you need to change the name of the field, not the label.
-
Your field name is "images" - it's the label that you've set to "myphoto". Just replace the call to "myphoto" with "images" and you should be fine!
-
Yeah, those should all work just fine. If they're not, then something must be odd with your settings somewhere. Is this online somewhere I could take a look?
-
Very late response to this, but I would like to follow up on this. I specifically testing BCE with importing CSV to the MapMarker module and it worked fine (if you set up the CSV field pairings correctly. It should also work with the Leaflet map as well. If you have time, it would be great to hear how you set these up in case there is actually a problem still.
-
I have had random failures on an old shared host that I no longer use. I never got around to debugging, but I wondering if it's a curl issue. I'd be curious if you have better luck disabling curl here: https://github.com/processwire/processwire/blob/57b297fd1d828961b20ef29782012f75957d6886/wire/core/WireHttp.php#L639 Just remove 'curl' from the $allowMethods array. It should resort to fopen and socket consecutively if curl fails completely, but maybe there is some curl setting on that host that is randomly problematic with Github. Not sure, but maybe worth a try.
-
@tpr's awesome Admin On Steroids (http://modules.processwire.com/modules/admin-on-steroids/)
-
There is slight mistake in what @PWaddict wrote - you still need to access that "first" image in the array I would also advise using more meaningful variable names, eg use $repeater_item rather than $image in the loop, because it's not actually the image that you are getting, but rather the repeater item that has title, body, and image field in it. foreach($page->your_repeater_field as $repeater_item) { echo "<img src='$repeater_item->your_image_field->first->url'>"; } The other option is this if you want to output all images from your image field. foreach($page->your_repeater_field as $repeater_item) { foreach($repeater_item->your_image_field as $image) { echo "<img src='$image->url'>"; } }
-
Repeaters are another one of those fields that returns an array so you need to foreach through each of the repeater items, then grab the images from that repeater item. On mobile so no code example but hope that makes sense.
-
Unless set to "1", image fields return an array (as do File fields, and many others). You have to either foreach through all images, all call a specific one. You can do: first(), last(), or eq(n). Read more about it here: https://processwire.com/api/fieldtypes/images/
-
For a little more info on what I found which will hopefully help others: There were lots of JS errors in the browser developer tools Console tab like this: Uncaught SyntaxError: Unexpected token < which is a good indication that there is an error message, or at least some HTML being returned in the AJAX request which is not expected by the JS script. So then I went to the Network tab of the developer tools and found the script that is uploading images (?id=1&InputfieldFileAjax=1), and checked the response - that is where I found this login form: Also. of course, when I saved the page, it asked me to login again, so that was also a hint. @Roberts R mentioned that he didn't get the console errors - turns out he didn't have "Disable Cache" checked on the Network tab and apparently that made a difference. I always have it checked because Chrome caching drives me crazy but this might be a helpful hint for others.
-
Remove "#" from index number on repeater label
adrian replied to Chris Falkenstein's topic in General Support
Yeah, hooks are very cool and not as scary as they may first appear. Be sure to check out the Captain Hook panel in Tracy - it gives you a list of available hooks for each file/class/module in ProcessWire. It can take a little time to figure out what you should be looking for, but once you do, the skies the limit! -
Remove "#" from index number on repeater label
adrian replied to Chris Falkenstein's topic in General Support
Yes, you will need to create it. Basically any code in that file will be run when ProcessWire is "ready". You can read more about it here: https://processwire.com/blog/posts/processwire-2.6.7-core-updates-and-more/#new-core-files-for-site-hooks -
Remove "#" from index number on repeater label
adrian replied to Chris Falkenstein's topic in General Support
Sorry for the delay - I got sidetracked. You can fix this easily with a little hook magic. Place this in your /site/ready.php file: $this->addHookAfter("InputfieldRepeater::renderRepeaterLabel", function($event) { $return = $event->return; $event->return = str_replace('#', '', $return); }); -
Remove "#" from index number on repeater label
adrian replied to Chris Falkenstein's topic in General Support
Sorry, ignore the stupidity in my last post - I did #1 instead of #n I'll look into it and get back to you in a minute -
Remove "#" from index number on repeater label
adrian replied to Chris Falkenstein's topic in General Support
-
Have you checked the console's Network tab - of course make sure this is open before you upload the images, and start by clearing any existing items to make it easier to see - sorry if this is obvious to you already. Do you have PW's debug mode turned on? Also, installing Tracy Debugger might show some otherwise missed errors.
-
-
My guess is that it's Apache's mod_security module blocking those filenames. What happens if you upload 5 images with other filenames?
-
Storing form/quiz/survey data in PW pages is great idea. I would even use the fields from the template that stores the data as the way to build the form that users will access on the frontend. After each question has been answered, add that answer to the appropriate field on the page and then reload with the next field/question. Obviously you could delete the page when you get to the end of the process, but honestly I would keep them - why not keep the data - you never know when you might find it useful As far as naming pages, I would go with the ID of the new page as the name and title.
-
Something inserts "/processwire/" in my form label
adrian replied to modifiedcontent's topic in General Support
Yeah, it's a bug in the file compiler: https://github.com/processwire/processwire-issues/issues/98 As a workaround, replace the space with a , eg: <label for=pass2>New Password (Confirm)</label> -
$image = $page->images->get("name=myimage.jpg"); $image->width();
-
Sorry
- 11 replies
-
- 1
-
-
- animated gif
- gif
-
(and 1 more)
Tagged with:
-
Yep - another Captain Hook update. Often hookable methods for a class are derived from a parent class. Take the "Roles" class for example. It lists add, delete, & save as the hookable methods that are available. But because it extends the "PagesType" class, its hookable methods are also available from the "Roles" class, eg: Roles::deleted. To make these derived methods easier to find, I have added a new: ClassName extends ParentClassName line to each file section. Both names are also linked directly to the API docs so you can find out more info there as well.