简体   繁体   English

在AngularJS应用程序中正确包含Wordpress博客的策略

[英]Strategy to properly include Wordpress blog within an AngularJS app

I'm writing an AngularJS/Express/NodeJS/MongoDB website. 我正在写一个AngularJS / Express / NodeJS / MongoDB网站。 Within this website, on the navigation bar, there's a section called "Blog", another section called "Advice articles". 在该网站的导航栏上,有一个名为“博客”的部分,另一个有“建议文章”的部分。 I intended to use Wordpress to publish the blog and publishing articles on my site, due to its outstanding ability as a blogging and CMS platform. 由于其出色的博客和CMS平台功能,我打算使用Wordpress在我的网站上发布博客和发布文章。 My question is how to properly integrate Wordpress into AngularJS/Express/MongoDB system? 我的问题是如何将Wordpress正确集成到AngularJS / Express / MongoDB系统中? I have come across articles on how to include AngularJS as a Wordpress subpages, but I haven't seen any articles on how to include Wordpress as an AngularJS subpage. 我见过有关如何将AngularJS包括在Wordpress子页面中的文章,但我还没有见过任何有关如何将Wordpress包括在AngularJS子页面中的文章。 Does anyone here know any tips/pointers/articles on such a strategy ? 在座的任何人都知道有关这种策略的任何提示/技巧/文章吗?

My current strategy is : 我目前的策略是:

  1. Let AngularJS routing service handle the route to "Blog" section. 让AngularJS路由服务处理到“博客”部分的路由。

  2. "Blog" section is template, which includes an iframe, that points to the Wordpress site, sth like this : “博客”部分是模板,其中包括一个指向ipress网站的iframe,如下所示:

    <div> <iframe frameborder="0" height="800" width="1200" scrolling="no" ng-src="http://localhost/wordpress/?page_id=4"></iframe></div>

I can display the blog by this strategy. 我可以通过这种策略来显示博客。 But it still a little bit off, I have to do some manual CSS. 但是仍然有点问题,我必须做一些手动CSS。 Is there a better way to do this out there ? 有没有更好的方法可以做到这一点?

Also since I want to allow the user to comment on page without asking them to log in again. 另外,由于我想允许用户在页面上发表评论而不要求他们再次登录。 How do I integrate the login done in Express/MongoDB with Wordpress user login, which is a PHP/MySql system. 如何将Express / MongoDB中完成的登录与Wordpress用户登录(PHP / MySql系统)集成在一起。 Are there any article out there that shows how to implement this ? 是否有任何文章显示如何实现此目的?

Thanks in advance, 提前致谢,

PS : I do not want to go the route of rewriting my site as a Wordpress plugin, I and my friends want to maintain AngularJS/Express/Node/MongoDb as our primary MVC stack. PS:我不想走一个用Wordpress插件重写我的网站的路线,我和我的朋友们希望将AngularJS / Express / Node / MongoDb保持为我们的主要MVC堆栈。

我的建议是使用wordpress插件制作wordpress API,并通过JSON API构建通讯angularJS和wordpress,阅读本文

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM