• Resolved Passl

    (@passl)


    Hey,
    can I show multiple projects and use Filters?

    I have a project with all services (myservice1, myservice2…) and one with a Service with city (eg. myservice-berlin).

    Now on a separate MPG Project only with cities I want show all services in this City.
    So I must use a Join like in MySQL.

    eg. My third project has only the city (eg. Berlin, Hamburg etc.)
    On these pages I want to show all the Services in this City.
    My idea was to have a shortcode or a function to get all projects and Filter.

    Is it possible?

    • This topic was modified 3 years, 4 months ago by Passl.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi, Passl

    No, it’s not possible to join a few others projects by field value.
    The closest functionality that you asking for, it’s [mpg_match]

    Docs here: https://docs.mpgwp.com/article/32-how-do-i-generate-list-of-nested-pages

    Regards

    Thread Starter Passl

    (@passl)

    I’ve created a custom shortcode for these function. I used the mpg_projects DB table and iterate trough the entries.
    But now I have another problem. In my shortcode I can’t use the mpg_city variable of my CSV.
    Is there another option to get the current url or MPG variable?

    If you would like to replace shortcodes in a string – use MPG_CoreModel::mpg_shortcode_replacer($string_with_shortcodes, $project_id);

    Use this method to get requested URL:
    MPG_Helper::mpg_get_request_uri();

    Thread Starter Passl

    (@passl)

    Ok. I get the url by using $wp->request and extracted the url in an array.
    Then do something more ??
    Ist works.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Shortcode for multi projects’ is closed to new replies.