Route generation or chooser in tinymce bundle with symfony2 - symfony

I'm working on sample application written with symfony2 and I want to add some cms funcionality (standard manage page entities) and the problem is routing in tinymce wysiwyg editor for links. It will be nice if user will be able to choose route to symfony application page when it want's to add link in the content. Is there a solution / plugin for that problem?

I don't know of a route exposing bundle with a plugin for TinyMCE but you can easily write one yourself with:
FOSJSRoutingBundle
For security reasons not all routes will be exposed by default.
After installing the bundle as described in the README. Expose routes like this:
my_route_to_expose:
pattern: /foo/{id}/bar
defaults: { _controller: HelloBundle:Hello:index }
options:
expose: true

Related

Symfony FOSUserBundle https in mails

Symfony 3.4. I have a problem with forcing mailer use only https with URLs in mail such as activation/forgot password mail from FOSBundle, example:
message: |
Hello %username%!
To finish activating your account - please visit %confirmationUrl%
This link can only be used once to validate your account.
Regards,
the Team.
is there way to force mailer use https for %confirmationUrl% and others? Thanks!
Force the routes -that are used to generate full URL's- to https. See this page.
To do that you will have to add your own version of the fosuserbundle routing. You can find the routing files here.
Copy them to your src/AppBundle/Resources/config bundle directory and edit them to make them force https and change app/config/routing.yml to include your own files

Symfony 3: Integrate Wordpress for FRONTEND NICE DISPLAY PURPOSE

I am looking for solutions to integrate WordPress to Symfony 3.
My Symfony 3 project is running well with its own custom functionalities but the landing page looks lame compare to a WordPress landing page.
Now I want to update the visual of the landing page. Knowing that is something easy to do with a WordPress template, I am looking for this solution. (I might delegate the building of the WordPress site but need to be sure I can connect it with my existing Symfony 3 project.)
I found plenty of input on the subject, most of them are olds like: this one or that one.
There is also the EkinoWordpressBundle and symfony-wordpress-edition. But those seem to integrate Symfony within WordPress, and as I only require WordPress for display purposes I'd rather have it the other way around.
Any suggested direction to achieve that?
Follow these steps:
Place your wordpress installation into the /web folder e.g /blog
edit your symfony .htaccess file, then comment out this line.
DirectoryIndex app.php
Run your Wordpress as normal i.e wwww.domain.com/blog

Need To Run Symfony + ReactJS & WordPress Together

For our project we decided for a Symfony app and a WordPress blog. It basically runs an entire installation of WordPress as a subdirectory called /blog inside the /web folder of Symfony.
We setup a quick coming soon page on www.example.com/ (Symfony Route: /) and kept running WordPress blog on www.example.com/blog/
Details about that setup on my question about WordPress as a Symfony subdirectory:
WordPress As A Symfony (Symfony3) Subdirectory
Over the course of development we let Symfony power the REST API and developed the application frontend with ReactJS. I am very unsure about the deployment. How will this work?
Note: I can't display WordPress as a React frontend and WordPress REST API because over 200 posts are now designed using a page builder provided by the theme (Lesson learned).
What options do I have?
You have to create a minified version of the React app and load it from a twig template. If you are using any react router, you will have to deal with the base url of your panel to make the urls be valid.
For instance, if you develop with a local server:
localhost:3000/my/fancy/panel
in production can happen that this url becomes
www.yourdomain.com/users/panel/my/fancy/panel
You you have to configure your router and routes to prefix /users/panel in production environment.
In my case I inject that base url in the tpl or twig and the app doesn't need to care about the environment.
Your app needs to display the Wordpress posts?

Sonata SEO Bundle Site MAP

I am using sonata seo bundle and knp paginator bundle.
My Question is When I added new custom static url like :-(www.symfony.in/blog)
in our KNP Menu.It's added successfully. But When I run the :-
php app/console sonata:seo:sitemap --scheme=http web www.symfony.in --env=prod
Command execute successfully But in sitemap Blog url(www.symfony.in/blog) not added.
Any one know how to add custom url in Sonata SEO Bundle in Sitemap ?
I am google it but nothing found !
Thnaks!
You need to create a SitemapIterator in order to add your custom URLs to the Sitemap, as described in the documentation. This is an Iterator that you will have to declare as a service, and then reference into the sonata_seo.sitemap.services configuration.

Symfony2 - 301 redirects for article posts

I'm fairly new to Symfony2 and redirects, I am trying to move posts from an articles section into a new section of a website.
Also, do I just leave the original articles as they (as they are indexed with Google's SEO) are in the MySQL database and create new versions of them in the new section?
E.g.,
original location:
http://example.com/articles
http://example.com/articles/this-is-article-1
new location:
http://exmaple.com/
http://example.com/this-is-article-1
I've come across the following in the Symfony2 Cookbook but I am unsure which one I would use.
http://symfony.com/doc/current/cookbook/routing/redirect_in_config.html
What you can do is to keep your old routing and add new route in your routing yml or annotation to point to the same action in your controller, this way you keep your old routing to articles which are SEO indexed and use your new routes in your twigs so that they get indexed with time, when you feel the need you don't need the old routing you can delete them when the new routes get better SEO.
Another solution which is redirecting as you asked is this :
routing.yml
root:
path: /articles
defaults:
_controller: FrameworkBundle:Redirect:redirect
route: new_route_name_articles_index
permanent: true
This will redirect your http://example.com/articles to your new routing that you created

Resources