Forum

Thread tagged as: Question, Members

Form template and Member data tags.

I have a site with a members area, and there are two forms in there that only members can submit. I would like to directly get the currently logged in member's first and last name, and other details that might be necessary.

I have done what is outlined here: https://docs.grabaperch.com/templates/apps/members/data/ with no luck. I have checked the DB and first_name is getting saved correctly.

Here is the first name input from the registration form:

perch:form id="register" method="post" app="perch_shop">

    <h2 class="text-upper text-larger">New customer</h2>

    <div class="row">
        <div class="column one-half">
            <legend class="text-large">About you</legend>
            <div>
                <perch:label for="first_name">First name</perch:label>
                <perch:input class="text-field text-field--dark"type="text" id="first_name" required="true" label="First name" />
                <perch:error for="first_name" type="required">Please add your name</perch:error>
            </div>

            <div>
                <perch:label for="last_name">Last name</perch:label>
                <perch:input class="text-field text-field--dark"type="text" id="last_name" required="true" label="Last name" />
                <perch:error for="last_name" type="required">Please add your name</perch:error>
            </div>

            <div>
                <perch:label for="email">Email</perch:label>
                <perch:input class="text-field text-field--dark"type="email" id="email" required="true" placeholder="you@company.com" helper="PerchMembers_Members::check_email" />
                <perch:error for="email" type="required">Please add your email address</perch:error>
                <perch:error for="email" type="helper">That email address is already in use</perch:error>
            </div>

            <div>
                <perch:label for="password">Create a password</perch:label>
                <perch:input class="text-field text-field--dark"type="password" id="password" required="true" match-with="password2" />
                <perch:error for="password" type="required">Please add a password</perch:error>
                <perch:error for="password" type="match">Passwords do not match</perch:error>
            </div>

            <div>
                <perch:label for="password2">Type your password again</perch:label>
                <perch:input class="text-field text-field--dark"type="password" id="password2" required="true" />
                <perch:error for="password2" type="required">Please repeat your password</perch:error>
            </div>
        </div>

        <div class="column one-half">

            <legend class="text-large">Billing address</legend>
            <div>
                <perch:label for="address_1">Address 1</perch:label>
                <perch:input class="text-field text-field--dark"type="text" id="address_1" required="true" label="Address 1" />
                <perch:error for="address_1" type="required">Please add the first line of your address</perch:error>
            </div>

            <div>
                <perch:label for="address_2">Address 2</perch:label>
                <perch:input class="text-field text-field--dark"type="text" id="address_2" label="Address 2" />
            </div>

            <div>
                <perch:label for="postcode">Post code</perch:label>
                <perch:input class="text-field text-field--dark"type="text" id="postcode" label="Postal code" />
            </div>

            <div>
                <perch:label for="city">City</perch:label>
                <perch:input class="text-field text-field--dark"type="text" id="city" label="City" />
            </div>

            <div>
                <perch:label for="state">State</perch:label>
                <div class="select-arrow select-arrow--dark">
                    <perch:input class="select-field select-field--register" type="select" id="state" label="State" options="New South Wales, Victoria, Queensland, Canberra, South Australia, Western Australia, Northern Territory, Tasmania" />
                </div>
            </div>


        </div>
    </div>
    <div class="row text-center pad">
        <span class="button bg-red">
            <perch:input class="button__inner bg-red" type="submit" value="Go to checkout" />
        </span>
    </div>


    <perch:success>
        <p>Thanks!</p>
    </perch:success>

</perch:form>

and in the template:

<perch:form id="member-request-form" app="perch_forms" method="post" class="bg-light-grey pad">

    <div class="row">
        <div class="one-half column"><p>1<perch:member id="first_name"></p></div>
    </div>
    <div class="row">
        <perch:label for="description">Describe your request</perch:label>
        <perch:input id="description" name="description" type="text" label="Description" class="text-field" />
    </div>
    <div class="row">
        <perch:label for="details">Add a detailed request</perch:label>
        <perch:input id="details" name="detail" type="textarea" label="Details" class="text-field" />
    </div>

    <div class="row">
        <perch:input type="submit" value="Submit" class="button__inner bg-red" />
    </div>

</perch:form>

adding <showall /> doe not return anything related to perch members, or any other app for that matter.

Diagnostics for good measure.

Perch: 2.8.32
Production mode: Production (100)
Installed apps: content (2.8.32), assets (2.8.32), categories (2.8.32), perch_blog (5.0), perch_events (1.9.3), perch_forms (1.8.3), perch_shop_orders (1.0.9), perch_shop_products (1.0.9), perch_shop (1.0.9), perch_members (1.5), sendgrid_subscribe (1.0)
DB driver: PDO
DB tables: perch2_blog_authors (1), perch2_blog_comments (0), perch2_blog_index (230), perch2_blog_posts (9), perch2_blog_posts_to_tags (0), perch2_blog_sections (1), perch2_blog_tags (0), perch2_blogs (1), perch2_categories (11), perch2_category_counts (6), perch2_category_sets (2), perch2_content_index (916), perch2_content_items (163), perch2_content_regions (38), perch2_events (11), perch2_events_categories (0), perch2_events_to_categories (0), perch2_forms (5), perch2_forms_responses (11), perch2_members (11), perch2_members_forms (1), perch2_members_member_tags (16), perch2_members_sessions (5), perch2_members_tags (8), perch2_my_sample_things (1), perch2_navigation (0), perch2_navigation_pages (0), perch2_page_templates (2), perch2_pages (11), perch2_resource_log (313), perch2_resource_tags (0), perch2_resources (99), perch2_resources_to_tags (0), perch2_settings (29), perch2_shop_addresses (116), perch2_shop_admin_index (28), perch2_shop_brands (1), perch2_shop_cart (61), perch2_shop_cart_data (309), perch2_shop_cart_items (139), perch2_shop_countries (250), perch2_shop_currencies (152), perch2_shop_customers (33), perch2_shop_emails (1), perch2_shop_index (317), perch2_shop_option_values (0), perch2_shop_options (0), perch2_shop_order_items (44), perch2_shop_order_promotions (0), perch2_shop_order_statuses (9), perch2_shop_orders (46), perch2_shop_orders_meta (1), perch2_shop_product_files (2), perch2_shop_product_option_values (0), perch2_shop_product_options (0), perch2_shop_product_tags (0), perch2_shop_products (5), perch2_shop_promotions (0), perch2_shop_search (5), perch2_shop_shipping_zone_countries (1), perch2_shop_shipping_zones (1), perch2_shop_shippings (1), perch2_shop_tax_exhibits (118), perch2_shop_tax_group_rates (1), perch2_shop_tax_groups (1), perch2_shop_tax_locations (1), perch2_shop_tax_rates (1), perch2_shop_variants (0), perch2_user_passwords (0), perch2_user_privileges (79), perch2_user_role_privileges (16), perch2_user_roles (2), perch2_users (1)
Users: 1
App runtimes:
<?php
    $apps_list = array(
        'content',
        'categories',
        'perch_members',
        'perch_shop',
        'perch_events',
        'perch_forms',
        'perch_blog'
    );
Scheduled tasks for perch_blog: delete_spam_comments (1440 mins)
Scheduled tasks for perch_events: update_category_counts (60 mins)
Editor plug-ins: markitup, redactor, tinymce
H1: 421aa90e079fa326b6494f812ad13e79
L1: 9ae010791017183246e8e2ac51472ba8
F1: 2edba60ed1f613d6dd804feb202456a2
headerColour: #ffffff
content_singlePageEdit: 1
helpURL:
siteURL: /
hideBranding: 0
content_collapseList: 1
lang: en-gb
update_2.8.32: done
update_2.8.30: done
latest_version: 2.8.15
on_sale_version: 2.8.32
perch_shop_update: 1.0.9
headerScheme: light
perch_members_login_page: /members/login.php?r={returnURL}
perch_shop_price_tax_mode: exc
perch_shop_site_url: https://
perch_shop_product_url: /shop/products/{slug}
perch_shop_invoice_number_format: Invoice%d
dashboard: 0
hide_pwd_reset: 0
content_hideNonEditableRegions: 0
content_frontend_edit: 0
perch_shop_default_currency: 8
perch_shop_reporting_currency: 8
perch_members_update: 1.4
perch_events_update: 1.8
perch_events_detail_url: /events/
perch_blog_update: 5.0.1
perch_blog_post_url: /blog/post.php?s={postSlug}
PERCH_DEVELOPMENT: 10
PERCH_STAGING: 50
PERCH_PRODUCTION: 100
PERCH_DB_USERNAME: root
PERCH_DB_SERVER: localhost
PERCH_DB_DATABASE: ali
PERCH_DB_PREFIX: perch2_
PERCH_TZ: Australia/Melbourne
PERCH_EMAIL_FROM: locky@moworks.com.au
PERCH_EMAIL_FROM_NAME: Locky Keaney
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/nathan/Documents/LOCAL/clients/ali/www/perch
PERCH_CORE: /Users/nathan/Documents/LOCAL/clients/ali/www/perch/core
PERCH_RESFILEPATH: /Users/nathan/Documents/LOCAL/clients/ali/www/perch/resources
PERCH_RESPATH: /perch/resources
PERCH_HTML5: 1
PERCH_DEBUG: 1
PERCH_RUNWAY:
PERCH_ERROR_MODE: DIE
PERCH_DATE_LONG: %d %B %Y
PERCH_DATE_SHORT: %d %b %Y
PERCH_TIME_SHORT: %H:%M
PERCH_TIME_LONG: %H:%M:%S
PERCH_RUNWAY_ROUTED:
PERCH_STRONG_PASSWORDS:
PERCH_PREVIEW_ARG: preview
PERCH_TEMPLATE_PATH: /Users/nathan/Documents/LOCAL/clients/ali/www/perch/templates
PERCH_DEFAULT_DOC: index.php
PERCH_DEFAULT_EXT: .php
PERCH_PRODUCTION_MODE: 100
PERCH_RWD:
PERCH_HTML_ENTITIES:
PERCH_SSL:
PERCH_STRIPSLASHES:
PERCH_PROGRESSIVE_FLUSH: 1
PERCH_PARANOID:
PERCH_FORCE_SECURE_COOKIES:
PERCH_PASSWORD_MIN_LENGTH: 6
PERCH_MAX_FAILED_LOGINS: 10
PERCH_AUTH_LOCKOUT_DURATION: 1 HOUR
PERCH_VERIFY_UPLOADS:
PERCH_AUTH_PLUGIN:
PERCH_DB_CHARSET: utf8
PERCH_DB_PORT:
PERCH_DB_SOCKET:
PERCH_SESSION_TIMEOUT_MINS: 20
PERCH_SHOP_VERSION: 1.0.9
PERCH_APPS_EDITOR_PLUGIN: markitup
PERCH_APPS_EDITOR_MARKUP_LANGUAGE: textile
HOSTING SETTINGS

PHP: 5.6.10
Zend: 2.6.0
OS: Darwin
SAPI: apache2handler
Safe mode: not detected
MySQL client: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $
MySQL server: 5.5.42
Free disk space: 823.57 GB
Extensions: Core, date, ereg, libxml, openssl, pcre, sqlite3, zlib, bcmath, bz2, calendar, ctype, curl, dom, hash, fileinfo, filter, ftp, gd, SPL, iconv, intl, json, ldap, mbstring, session, standard, mysqlnd, mysqli, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, mysql, SimpleXML, soap, sockets, exif, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, apache2handler, imap, yaz, mcrypt, gettext, pgsql, pdo_pgsql
GD: Yes
ImageMagick: No
PHP max upload size: 50M
PHP max form post size: 50M
PHP memory limit: 128M
Total max uploadable file size: 50M
Resource folder writeable: Yes
Session timeout: 24 minutes
Native JSON: Yes
Filter functions: Yes
Transliteration functions: Yes
HTTP_HOST: localhost:8888
HTTP_CONNECTION: keep-alive
HTTP_UPGRADE_INSECURE_REQUESTS: 1
HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36
HTTP_ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
HTTP_REFERER: https://localhost:8888/perch/core/settings/diagnostics/
HTTP_ACCEPT_ENCODING: gzip, deflate, sdch, br
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_COOKIE: olfsk=olfsk05045050452685351; hblid=HCaJKeN7ByadWFcR3m39N5PEIE3RNE0o; _hjIncludedInSample=1; cmsa=1; SQLiteManager_currentLangue=2; p_m=9800587c490c37ba1ce49e704e41621885684fe9; _ga=GA1.1.435860665.1482105452; _gat=1; PHPSESSID=25e25d451781f68b5d376e9b7149bff6
PATH: /usr/bin:/bin:/usr/sbin:/sbin
SERVER_SOFTWARE: Apache/2.2.29 (Unix) mod_wsgi/3.5 Python/2.7.10 PHP/5.6.10 mod_ssl/2.2.29 OpenSSL/0.9.8zh DAV/2 mod_fastcgi/2.4.6 mod_perl/2.0.9 Perl/v5.22.0
SERVER_NAME: localhost
SERVER_ADDR: ::1
SERVER_PORT: 8888
REMOTE_ADDR: ::1
DOCUMENT_ROOT: /Users/nathan/Documents/LOCAL/clients/ali/www
SERVER_ADMIN: you@example.com
SCRIPT_FILENAME: /Users/nathan/Documents/LOCAL/clients/ali/www/perch/core/settings/diagnostics/index.php
REMOTE_PORT: 64829
GATEWAY_INTERFACE: CGI/1.1
SERVER_PROTOCOL: HTTP/1.1
REQUEST_METHOD: GET
QUERY_STRING: extended
REQUEST_URI: /perch/core/settings/diagnostics/?extended
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
PHP_SELF: /perch/core/settings/diagnostics/index.php
REQUEST_TIME_FLOAT: 1482112399.24
REQUEST_TIME: 1482112399
argc: 1
Locky Keaney

Locky Keaney 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

How are you displaying the form?

Using a content region and a template.

Drew McLellan

Drew McLellan 2638 points
Perch Support

If you're using perch_content(), switch to perch_content_custom()