-
Posts
11,182 -
Joined
-
Last visited
-
Days Won
372
Everything posted by adrian
-
What about this one: https://processwire.com/talk/topic/6003-conflict-bw-parent-of-selectable-pages-and-custom-selector/?p=58695 Seems like it matches your scenario of having a custom selector. To quote arjen: "I think you have to "unselect" the Parent of selectable page(s)."
-
Then it sounds like you are running an old config.php file - a version of PW from before that setting was added. You can grab a new version and take a look through to see if there are any other new settings you are missing. I don't recommend replacing it with a new version - you're better off just adding the new settings to make sure you don't break any of your database settings, userAuthSalt etc.
-
Back at my desk again, and thinking through this properly - I think the better option is actually: $np->images->add($p->images->last()->filename); You either need the full URL or the full disk path. I think that is where you were having trouble. In my first example, it wasn't working without the 'http://'.$config->httpHost part, but using "->filename" works great and is cleaner!
-
Should be right at the very end: $config->httpHosts
-
In a rush so not the cleanest code, but this seems to work for me - is this what you are looking for? $p = $pages->get(xxxx); //id of page to copy $np = new Page(); $np->of(false); $np->parent = $pages->get(1); //set parent to homepage $np->template = "basic-page"; $np->title = 'test new page'; $np->save(); $np->images->add('http://'.$config->httpHost.$p->images->last()->url); $np->save();
-
But if you want to add Bootstrap to an existing PW install, you really only need to grab the bootstrap files - put the css and js files in appropriate locations and then modify your template files to use the div structure and css classes that bootstrap requires to work it's layout. Shouldn't be too difficult at all if you are html/css savvy.
- 3 replies
-
- 2
-
-
- PROCESSWIREBOOTSTRAP3
- module
-
(and 2 more)
Tagged with:
-
I think the PageTable field from a recent dev version is likely a good option, but another alternative is: https://processwire.com/talk/topic/6102-batch-child-editor/ In the modules config settings you may want to disable overwrite mode (and maybe even Add mode). See the screenshot under 3. Edit mode - it allows for easy adding, sorting, and editing of titles, along with modal editing of pages, kinda like PageTable, but unlike with PageTable, pages that are added manually as children will also be available for editing via this interface.
-
I appreciate blad's investigations into the issue and PM'ing @Vizz to alert her of the problem. We should all be informed (and help to inform others) about the potential issues with the systems we use, or maybe considering to use at some point. I just felt that the tone of the conversation had started to cross the line from being helpful, towards the bashing of WP. I know I have been guilty of criticizing certain aspects of all of the big three CMS's in my discussions with clients. I just think those thoughts should be kept out of this forum. I think in reality it's a shame this thread exists in the first place - it's not really appropriate for this forum, but maybe I am over-reacting - from my experience here I don't think anyone here would really start a flame war about any other system - these forums just don't have that vibe
- 22 replies
-
- 3
-
-
- web design
- web development
-
(and 1 more)
Tagged with:
-
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