[MediaWiki-l] Drupal 7 and MediaWiki
bawolff at gmail.com
Wed Jul 19 21:49:52 UTC 2017
You may also want to look into index.php?action=render&title=foo if you are
doing this sort of thing.
On Wednesday, July 19, 2017, Greg Rundlett (freephile) <greg at freephile.com>
> On Wed, Jul 19, 2017 at 2:53 PM, Johnny Guo <jguo1400 at gmail.com> wrote:
>> I was wondering if it was possible to have a MediaWiki section inside a
>> Drupal website and how it would be done.
> Any more details on what you're trying to accomplish?
> Are you talking about a "headless" or "decoupled" content reuse through
> API? Drupal allows PHP code in pages, and MW has an API. So, if all you
> want to do is have some wiki page content show up on your Drupal site, you
> can do that with a few lines of PHP code.
> This wiki content:
> is re-used via API on this Drupal 7 page:
> By writing a few lines of PHP code in the Drupal page:
> require '/path/to/autoload.php';
> $apiQuery = "?action=parse&page=Rates&format=json";
> $MwApi = new \eqt\wikireport\MwApi('https://freephile.org/w/api.php');
> $data = $MwApi->data;
> print ($data['parse']['text']['*']);
> The autoload.php file in the first line above is something I generated
> Composer for the WikiReport project, and essentially all it does is load a
> very basic class that I wrote to make queries to the MediaWiki API:
> There are all kinds of possibilities, so I'm just guessing at what you're
> trying to accomplish.
> ~ Greg
> Greg Rundlett
> https://eQuality-Tech.com <https://equality-tech.com/>
>> MediaWiki-l mailing list
>> To unsubscribe, go to:
> MediaWiki-l mailing list
> To unsubscribe, go to:
More information about the MediaWiki-l