-
Posts
11,097 -
Joined
-
Last visited
-
Days Won
365
Everything posted by adrian
-
Hi everyone! I think we are might be heading into dangerous territory here. I don't think any forum should become a place for bashing another product. This forum has by far the best community I have ever experienced - let's make sure that as we grow that we keep it that way This thread is a bit of a mix - it sounds like there has been some PM'ing going on to suggest fixes, which is positive and helpful. I also think that some of the posts here about WP bringing down PW are probably in jest If one of us finds a site mentioned here that is vulnerable (no matter the CMS), I think the best approach would be to contact them directly (PM etc) with some advice on how to remedy it, rather than criticizing their choice of CMS. Point them to resources that will help them. There are several groups out there that identify security holes in a variety of software packages, including open source CMS's. They usually contact the developers first to ensure they have a chance to fix the issue before it becomes public. Certainly Wordpress has its issues for inexperienced sys admins, but it can be made much more secure with a variety of simple techniques that are widely available with a quick google search. There are even some plugins designed to block a variety of common attacks. But Wordpress is certainly not alone - unfortunately no system is immune to vulnerabilities, especially those that allows for third party plugins/modules. Above all, let's not come across as too superior - it might just bite us one day! Thanks for listening to my thoughts on this - I am not aiming direct criticism at anyone - just trying to establish a general approach to these types of topics. Any thoughts?
- 22 replies
-
- 12
-
-
- web design
- web development
-
(and 1 more)
Tagged with:
-
Glad to hear it's working, although it was never designed to import parts of JSON files like that. You shouldn't have to do anything with renaming anything. Try again and grab the countries list from the shared packages option and import it to Home as the parent, or some other parent page, rather the countries and you won't get the duplication problem. Maybe that needs to be better documented.
-
This sounds awesome - I love the idea of being able to showcase modules - will it include admin access (in demo mode) for guests to be able to play to play with Process modules?
-
Did you try pasting just that snippet into Migrator or did you do it properly and import using the "Shared JSON Packages" option from within the Migrator import process? If the former, then I am not surprised because that JSON snippet doesn't contain everything needed. If the latter, could you please share the errors you got?
-
Take a look at one of the files in the PageLists repo on Github. Paste the contents into: http://json.parser.online.fr/beta/ to make it easier to view. It includes info on page title, name, sort order, parent, template etc. It also includes the info to create any required fields - eg country/state codes etc.
-
It really depends on what format you already have them in. A custom import script could be fairly easy to write making use of http://php.net/manual/en/function.str-getcsv.php. Take a look at the code that runs Ryan's CSV importer to figure out what you'll need to do. Once you are done though, I would encourage you to use Migrator to export as a page list that can be shared with others via: https://github.com/adrianbj/ProcessWirePageLists You'll see I already have a country set and some state sets for a few countries.
-
Are you actually importing pages with other content fields, or just wanting to create a series of pages and child pages with titles, ready to populate with other content? If the latter, then try: https://processwire.com/talk/topic/6102-batch-child-editor/ OR http://modules.processwire.com/modules/process-batcher/
-
Insert a paragraph inside a form built using API
adrian replied to enricob's topic in API & Templates
Ivan, I have learned things in lots of different ways. Some from searching/browsing the forum, some from studying the core code, some from looking at other's modules, sometimes looking back at my own modules. I sometimes have a hard time remembering how to do something, but I usually remember where I did it or where someone else did it, or at least the right term to search for. In this example, I have used Markup a couple of times in my modules now, but the first time I went to do something like that, I remembered that Hanna Code has a huge chunk of text under "PHP and Javascript usage notes" on the Code tab, so I went and looked how it was done! -
Insert a paragraph inside a form built using API
adrian replied to enricob's topic in API & Templates
$field = $modules->get("InputfieldMarkup"); $field->value = "Your paragraph text here"; -
Do either of these help shed any light on the problem? https://processwire.com/talk/topic/5594-page-1322-is-not-valid-for-some-page-name/ https://processwire.com/talk/topic/5083-possible-bug-page-fieldtype-with-custom-selector-to-find-selectable-pages-returns-error-while-saving-page/
-
Soma has a good point - at the moment if you have more than one image field on a page, the slider only shows up on the first one, but it controls the images on all of them.
-
Also, what about the possibility of setting up the slider with step options so it snaps to 1,2,3,4,5 images across? You could either use this approach: http://jsfiddle.net/3a2Tx/3/ if you want to keep it in %, or maybe change the slider to the number of images across with a simple step="1" and then convert these to the required % value.
-
Great improvements blad! The only thing I noticed is the sizing when you first load a page after installing the module - that is before the cookie is set for the first time - the slider is set to the left edge, but images in the grid were at three across (I think it was 3). So you grab the slider handle and move, but it instantly goes to maybe 10% because that's the position of the slider. From then on everything seems to work brilliantly! PS I still like the idea of being able to set the default width in the config settings, and maybe even an option to disable the adjustment slider - some users are easily confused You could maybe even make the slider available to some some user roles and not others, but I am probably getting carried away with things that really aren't necessary
-
By video embedder, do you mean tools like videojs, mediaelementjs, sublimevideo ? If so, you might find my Video fieldtype module useful. Along with support for uploading videos, it also has native support for playing the videos using sublimevideo by simply doing: echo $page->video_field->eq(0)->play;
-
Well getUnformatted is in the cheatsheet. Are you referring to the date function not being in there? Only reason is that it's a pure PHP function, rather than something that is part of the PW API so it doesn't really belong. I feel like it might belong in here (http://processwire.com/api/fieldtypes/) once Ryan gets around to adding info about the datetime fieldtype.
-
Nice one Sinnut - for some reason I always forget about "getUnformatted" - that is definitely the right PW way to do it and I guess one less conversion step along the way!
-
This should do it if your date is already formatted: $month = date("F", strtotime($page->date)); //strtotime converts a formatted date string back to a unix timestamp
-
I love what you've done here! Just a few small things. Modules in PW need to be named with an uppercase letter for each component of the name, eg: AltGrid - each file and the class should be named like this. Even though you can install it manually the way you have it now, it can't be installed automatically. Maybe a personal thing, but I'd like to see a little padding between each image in the grid. Any chance of storing the slider value so that it loads the last selected percentage? And/or have the % configurable in the module settings? Nice work - thanks!
-
There is no need for special API formatting - just make use of the PHP date function: http://php.net/manual/en/function.date.php $month = date("F", $page->date);
-
Here you go: https://processwire.com/talk/topic/2089-create-simple-forms-using-api/ Have a good read through that thread, create your form, have it process off to PayPal and then point Paypal back to an ipn.php file on your server that uses code based on: https://github.com/paypal/ipn-code-samples/commits/master/paypal_ipn.php Just bootstrap PW into that file and after processing, remove the unpublished status from the page.
-
I think it's easier to place files that are called via ajax from a directory outside of the PW "site" directory, eg: www.mysite.com/ajax/ajax.php
- 6 replies
-
- processwire
- ajax
-
(and 1 more)
Tagged with:
-
You could create this functionality yourself without too much work. I am not a form builder expert, but I have integrated PayPal into a manually created front-end form in PW. If you want to use FormBuilder I think you want to hook into: FormBuilderProcessor::formSubmitSuccess Do you already have form builder and access to the VIP support board for it? There are a lot of posts over there about hooking into it and adding functionality. Here is some info I posted about paypal integration with PW: https://processwire.com/talk/topic/5281-paypal-payment-method-for-processwire-shop/?p=67670 Using the IPN feature of PayPal to return payment success and then publish the page should be pretty straight-forward. Let us know if you have any more specific questions once you get started.
-
<link rel="stylesheet" href="<?php echo $config->urls->assets; ?>scripts/foundation/css/foundation.css"> Although the convention is to put them under templates/scripts etc, in which case you'd want: <link rel="stylesheet" href="<?php echo $config->urls->templates; ?>scripts/foundation/css/foundation.css"> This way you will always have the full url to each resource. You could also just do: <link rel="stylesheet" href="/site/templates/scripts/foundation/css/foundation.css"> These root relative paths will always work no matter what page you are on.
-
I can't see what is missing, but have you tried this approach to ensure that your call to load the module also loads all required js and and css files: foreach($config->scripts->unique() as $file) echo "\n\t<script type='text/javascript' src='$file'></script>"; foreach($config->styles->unique() as $file) echo "\n\t<link type='text/css' href='$file' rel='stylesheet' />";
-
You could also have these links added as entries to the Redirects module (http://modules.processwire.com/modules/process-redirects/).