166 posts in this topic
Recently Browsing 0 members
No registered users viewing this page.
Noob to Processwire. Trying to convert some older sites to Pwire. I am having trouble including a legacy form class into my templates:
If I embed the php directly in the template, it works. But if I use include statements, the form object returns null.
$form = new Form(init1, 'init2', ...');
$form->param1 = ...;
$form->param2 = ...;
$form->param3 = ...;
My referencing is OK, no error message. The only code that cannot reside in the include file are the following lines:
$form = new Form(init1, 'init2', ...');
My PhP is rusty, maybe that is the problem, but it could be something about Pwire, namespace maybe. I have tested it outside Pwire and no problems.
Please advise. Thanks.
Is there a module or plugin that is like a repeater but you can choose a template? I want something that let's me:
choose a template to get fields from, display these fields like a repeater does add new pages without adding a title or name (this might be achievable using other means like ProcessSetupPageName) delete pages I feel like somebody might have already made a module that does just this, however, I haven't found any. Perhaps there is a way of doing this with a standard repeater that I don't know about.
I have an issue where I want different formats for creating one page. When you are creating a new page I want it to offer different types of fields from when you are editing it.
For example, I have a field called countries which is a multiple page reference field. This is desirable as it is in a very easy to edit format. Currently, I am using selectize.js which makes it possible to search for the pages and add them in a tag fashion. This is how I want it to be when a page is already created. However, when creating a new page it is often easier to just paste a list of all the countries as text. This is because the data is coming from an old website where the countries are written like this:
I can code something which converts this text into the multiple page reference fields but I am not sure how to go about it. At first I tried making another template which had fields that were in this “quick” format. Then I planned to make it such that when you add one of these quick pages it creates a page in the standard format and deletes itself. This has it’s own problems such as where to place the new page, what title and name to give it, whether to have just one quick page or multiple and when to delete it. It just didn’t seem right.
Another possibility would be to show special quick fields when creating a new standard page but hide them when the page is saved and show the standard fields. I am not to sure how to achieve this though.
Does anyone know a better way of going about this? I feel like this is a simple problem which already has an elegant solution.
I recently installed PW 3.0.62 for a new site and also have sites running older version of PW 3.x.
Can I export the database on an older version of PW 3.x and import it to PW 3.0.62 without any issues?
(This is kind of alternative to the above for long term use - and maybe a better solution...)
On the sites I've previously built I have templates (home, basic-page, contact) and fields that I commonly use, such as business_name, phone_1. The last site I built is running PW 3.0.42. I was considering cloning this into a local site and running the upgrade module to bring it up to PW 3.0.62. From there on out when I start I new project I could just run the PW upgrade module, copy the folder to the location for the new project and duplicate the database using the new projects name.
So basically, I'll always keep a "blank slate" site that I can just run the PW upgrade on, then duplicate into a new project. This would cut down on the work and time spent having to re-create these common fields, that I use. From there, I would just add fields, templates, etc, specific for the new website project.
Is this a sound approach to speed up development?
In one Page I would like to put a lot of url.
There is url's field.
Now, I add url's field to one template, but I don't know to add 2 or 3 or 10 url's field in that same template... the problem is simple, but processwire don't allow it...