Skip to content

Use a React app in more than one page #12

Closed

Description

@rockiger

As a website maintainer, I want the React app I created in several places in my WP site, that I don't repeat myself.

  • Change model in the options
  • Create an update path
  • Create the possibility to add more pages to an app in the GUI
  • Let the user add an app to existing pages

Activity

  1. MauriceMorrey commented on Feb 28, 2022

    @MauriceMorrey
  2. rockiger commented on Mar 7, 2022

    @rockiger
    OwnerAuthor

    I couldn't find anything that would help.

    The approach in the article is to use WordPress's React installation, which it uses for Gutenberg and full-site editing. I can't think of a way I would hate more to develop React apps. Sorry, for being that harsh.

    I think the implementation should be pretty straight forward, if I find the time or somebody else is pitching in.

    We probably only need to make it possible to set more page slugs for a certain appname. The code at the moment does that:

    add_option('repr_apps', [[
    				'appname' => $appname,
    				'pageslug' => $pageslug,
    			]]);
    

    One solution would be to create 'more' apps or add a list of slugs. But the first approach seems more backwards compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions