[pdb_signup] Responsive?
-
Google Search Console says my site has Mobile Usability Issues, “Content wider than screen”. The page is my PDB signup form and yes it is not very usable from a mobile phone. I haven’t seen any documentation regarding making this responsive but I tried
template=responsive
andtemplate=bootstrap
just in-case, neither with any resolve. Is there a way to make the PDB signup form responsive?
-
If you’re seeing the GET requests, that’s the server log. It will be more helpful to see the php error log. You may need to set that up specifically.
As I said – nothing is written to the php_error.log when I load the signup page. It hasn’t been written to for several days.
Well, in the absence of error messaging, it’s hard to say. Sometimes php dumps it’s errors into the local directory instead of the one error log. This is a matter of the local php configuration not extending to the specific directory that the script getting the error is in. You may want to try turning the php ‘display_errors’ setting on (in your global php settings, not the local one) so the messages will get dumped to the screen while you’re developing.
Also, make sure the php version is 5.3 or later, but there may be a missing php extension.
I aren’t very familiar with WAMP or PHP so followed the instructions here. This showed that the current settings in C:\wamp64\bin\php\php7.2.14\php.ini are:
`
error_reporting = E_ALL
display_errors = On
`
I also inserted the following into the template pdb-signup-bootstrap.php at line 2, as I wasn’t sure whether or not it needed to be enabled in both places:
`
ini_set(‘display_errors’,1);
error_reporting(E_ALL);
`
No errors were displayed, nor was anything written to php_error.log, when the page containing
[pdb_signup template=bootstrap]
was loaded.When I tried to force an error by inserting
<?php zzzzzzzz ?>
at the end of pdb-signup-bootstrap.php an error message was displayed after the ‘Sign up’ button and messages were written to php_error.log. But when it was<?php $this->zzzzzzzz ?>
the page displayed was completely blank and nothing was written to the log.So it looks like only some errors are being reported with the current settings. Could you advise what needs to be set to enable all errors to be reported please, I aren’t clear what you meant by “in your global php settings, not the local one”.
You will see from the above that my PHP version is 7.2.14.
What PHP extension(s) might be required? Presumably ones that are used by the Bootstrap template but not the Default one. Are extension names all of the form
php*.dll
. There are no files like that in C:\wamp64.When the normal pdb-signup-bootstrap.php file is used the page source ends with
`
</body>
</html>
`
so it looks like the script is completing OK, but missing all the fields.I don’t have a list of needed php extensions, but I don’t rely on anything that is not standard. What sometimes happens is people do custom builds of php and use a different set of extensions, leaving some out that would normally be there.
I looked at the bootstrap template trying to see if there was anything in there that is different from the default template, but nothing looked like it could be a problem. Have you looked at the source to see if the HTML for the form is there but hidden?
Did we cover making sure you’re using the latest version of Participants Database?
My version of PDB is 1.9.3.1 , which has version 0.4 of the template.
In an earlier post @humpty2 said that he had a similar problem, but it used to be OK. When I replaced version 0.4 of the template with version 0.3 I found in a backup that worked OK.
The main difference between the two seems to be at line 26:
<?php if ( $this->group->has_fields() && $this->group->printing_title() ) : ?>
and a matchingendif
at line 56.When I commented out those two lines the fields were displayed OK.
When I inserted at line 25:
<?php echo "[" . $this->group->has_fields() . "|" . $this->group->printing_title() . "]<br>\n"; ?>
it printed out rows of[1|]
.
The problem seems to be that$this->group->printing_title()
is returning false every time, so I have worked around it by deleting that part of the condition.Why does it work OK for you but not for me? Do I need to specify somewhere that titles should be printed? I haven’t knowingly asked for them to be hidden, and can’t see an option like that in Manage Database Fields.
-
This reply was modified 5 years, 12 months ago by
wonderer0.
Thanks for your help xnau. I’m marking my issue as resolved.
Another problem closely related to
$this->group->printing_title()
returning nothing is that on the page none of the Field Groups has a header.Looking at the HTML source for a
[pdb_record]
page: each<fieldset>
contains a<legend>
as it’s first child, followed by a list of<div>
s, each containing a<label>
+<div>
pair.However for the
[pdb_signup]
page: each<fieldset>
just contains a list of<div>
s, each containing a<label>
+<div>
pair. Presumably it doesn’t have a<legend>
because$this->group->printing_title()
isn’t true.How do I specify that each Field Group should have a title? Doing so should fix both problems, without having to use a modified template.
To answer my own question above:
Ticking ‘Show Field Groups’ in ‘Signup Form Settings’ causes the title of each group to be shown, and all the fields displayed using the unmodified
pdb-signup-bootstrap.php
template file. Conversely un-ticking ‘Show Groups’ in ‘Record Form Settings’ prevents the titles of the groups from being shown in the[pdb_record]
page, but all the fields are still displayed, even when using the normal Bootstrap template.Perhaps the default should be to show the titles for both pages. People will then look round for ways to prevent them if they don’t like them.
The thinking behind hiding the group titles by default in the signup form is that your typical signup form has very few fields, so putting in the titles just adds unneeded clutter. It’s just hard to accommodate all the various uses the plugin gets put to.
I’m going to take a closer look at what you found to see if I need to structure the template better. Thanks for posting your findings.
Ordinary members won’t be using our system at all, so the
pdb_signup
form will be used in a way perhaps not intended. Our membership secretary, or another committee member, will use it to add new members’ information, and then use thepdb_record
form to edit or add details later as required. My thinking is that making the two forms as similar as possible means there is less to learn. The group headings are very helpful in making both forms easier to use.Many thanks for all your work on the PDB. It is very useful for a small social club like ours.
Hi,
I resolved responsive table with this CSS:
@media screen and (max-width: 600px) {
table {width:100%; margin:0px; border:0;}
thead {display: none;}
tr:nth-of-type(2n) {background-color: inherit;}
tr td:first-child {background: #f0f0f0; font-weight:bold; font-size:15px;}
tbody td {display: block; text-align:center;}
tbody td:before {content: attr(data-th); display: block; text-align:left;}
th {font-size:15px; display:block;border:0;}
td {border:0;}
tr td:first-child{background-color:#fff;font-size:15px;}
}-
This reply was modified 5 years, 8 months ago by
Cris.
please can the [pdb_signup template=boostrap] work on a local server? for example if you are using xampp to create wp website
-
This reply was modified 5 years, 12 months ago by
- The topic ‘[pdb_signup] Responsive?’ is closed to new replies.