• I’m new to WordPress. I’m moving over from Drupal (ugh! I’ve had a enough!). I was wondering, is there a way to create a VIEW (this is what it’s called in Drupal) that can retrieve data that has been submitted via a webform?

    EXAMPLE: On my website (Still running Drupal, building a WordPress site in the background). people can submit a school listing (name, address, website, etc). And when someone goes to the SCHOOL LISTING page it creates a “VIEW” (a page) displaying all submitted schools.

    Are there plugins for this? How does one go about creating this? Is it a widget I add to a page?

    As you can see I am very confused and extremely new to WordPress. Thanks in advance for your help.

    – Jeff

Viewing 7 replies - 1 through 7 (of 7 total)
  • Drupal 8 is really beautiful… but if you don’t know how to develop a website, you can use WordPress.

    Use WP_Query to get the data from the Data base:
    https://codex.www.ads-software.com/Class_Reference/WP_Query

    Make a template for the page or single in that you can see the data.
    Page Templates
    https://developer.www.ads-software.com/themes/template-files-section/page-templates/

    Here is another option to build the Query:

    Template Tag

    Just place both functions in your functions.php file. Then adjust the 1st function and add your custom table name. Then you need some try/error to get rid of the current user ID inside the resulting array (see comment).

    /**
     * Get "Leaders" of the current user
     * @param int $user_id The current users ID
     * @return array $query The leaders
     */
    function wpse50305_get_leaders( $user_id )
    {
        global $wpdb;
    
        return $wpdb->query( $wpdb->prepare(
            "
                SELECT <code>leader_id</code>, <code>follower_id</code>
                FROM %s
                    WHERE <code>follower_id</code> = %s
                ORDERBY <code>leader_id</code> ASC
            ",
            // Edit the table name
            "{$wpdb->prefix}custom_table_name"
            $user_id
        ) );
    }

    How to extend WP_Query to include custom table in query?
    https://wordpress.stackexchange.com/questions/50305/how-to-extend-wp-query-to-include-custom-table-in-query

    It sounds to me like you will need to look into using custom post types. Here are a couple articles to get you started…
    https://codex.www.ads-software.com/Post_Types
    https://www.wpbeginner.com/wp-tutorials/how-to-create-custom-post-types-in-wordpress/

    Personally, I like the WP-Types set of plugins for creating custom post types. You can find that here: https://wp-types.com/

    You will also want to look at Gravity Forms for creating the form on the front end. You can find that here: https://www.gravityforms.com/

    There is one more plugin that might help you for getting the form to save data to the custom post type… it is called Gravity Forms + Custom Post Types you can find that here: https://www.ads-software.com/plugins/gravity-forms-custom-post-types/

    Hope this helps!

    Drupal 8 is a shame. Drupal developers are ridiculous persons who do not know how to make an upgrade process easily.

    I agree with @makeonlineshop but at the same time Drupal does have its benefits… In any event, we are not here to discuss Drupal and how bad their processes are we are here to help @jcjxxl.

    jcjxxl, Please let us know if you have any further questions regarding the custom post types.

    Thread Starter jcjxxl

    (@jcjxxl)

    Sorry for the late response. Thank you everyone for jumping in and giving me some guidance. Like I said ‘m moving over from Drupal so it’s taking bit of getting use to. I’m going to give this a shot. It may be a few days before I get to it, but than yo again for the help!

    Thread Starter jcjxxl

    (@jcjxxl)

    Life has been busy but I have finally gotten around to the recommendations you guys posted. So I have created a new CUSTOM POST TYPE. This is very similar to CONTENT TYPE on Drupal. So simple enough for me to understand. I’m tacking on a second question to the original. I hope that’s ok.. The two tie together.

    I’ve created 9 “Custom Post” entries (School 1 info, School 2 Info, School 3 info, etc) and now would like to display those custom post entries ONE AT A TIME in a widget randomly. So as the visitor goes from one web page to the next there would be a widget on each page that would randomly pick one of the CUSTOM POST entries and display it. We’re trying to highlight different schools.

    So although the original question was about creating a full page from form entries (Custom Post) I would also like to know how to display ONE randomly chosen custom post entry in a widget that sits at the bottom of each page. I hope that makes sense. I apologize if I should have opened a second help topic but I felt this question ties directly into my original.

    Thank you again for all of the support. I am really enjoying the process of learning WordPress and the support this community has provide so far is great.

    Thanks again.

    Thread Starter jcjxxl

    (@jcjxxl)

    Ok. Disregard my last message. I figured it out.
    After creating my custom post type I used a plugin titled “CONTENT WIDGET” that allows you display the content of any post type. You can select the number of posts to display, randomize if you like,etc.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Drupal To WordPress – VIEWS LISTING’ is closed to new replies.