# How to transfer data from plugin to app/views templates?

**URL:** https://meta.discourse.org/t/how-to-transfer-data-from-plugin-to-app-views-templates/81528
**Category:** Development
**Created:** [February 26, 2018, 10:05am UTC](https://meta.discourse.org/t/how-to-transfer-data-from-plugin-to-app-views-templates/81528 "2018-02-26T10:05:21Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Stranik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stranik/32/85638_2.png) [@Stranik](https://meta.discourse.org/u/Stranik)
#### Post date: [February 26, 2018, 10:05am UTC](https://meta.discourse.org/t/how-to-transfer-data-from-plugin-to-app-views-templates/81528/1 "2018-02-26T10:05:21Z")

</div>

1. I created a test page using the plugin help

By placing the following code in the appropriate files.  
For example, in plugin.rb

```
Discourse::Application.routes.append do
  get '/help' => 'discourse_help/help#my_page'
end

load File.expand_path('../lib/dev/engine.rb', __FILE__ )

```

engine.rb

```
module DiscourseHelp
  class Engine < ::Rails::Engine
    isolate_namespace DiscourseHelp

    config.after_initialize do
		Discourse::Application.routes.append do
			mount ::DiscourseHelp::Engine, at: "/"
		end
    end
  end
end

```

Etc.

I can see this page very well in my browser. Nicely. Included the second browser did the User Agent as a search engine and looked at this page as it is seen by the robots (search engines).

Robots do not see the content of the page, but only see:

 ![%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%20%D0%BE%D1%82%202018-02-26%2013-00-48](https://global.discourse-cdn.com/meta/original/3X/7/9/79d7513a98dcbda4176c276159e694e874c7bbbd.png)

Perfectly. I then decided to check and put to check already working plugins (for example, static pages, which were offered here). The result is similar.

Search engines do not see the content of the pages they create. I. e., I cannot use such pages for search engines.

I would like to know what are the ways to pass plugin content to templates at: app/views

I beg forgiveness for my English, Google translator used.

* * *

Another example about which I wrote above.

[https://discourseleague.com/page/static-pages-plugin/1/](https://discourseleague.com/page/static-pages-plugin/1/)

 ![%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%20%D0%BE%D1%82%202018-02-26%2013-26-26](https://global.discourse-cdn.com/meta/original/3X/3/3/33656e0efbda628f43e268d7cd8b9876c8f034f6.png)

Etc. This is a general trend …

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 28, 2018, 2:19am UTC](https://meta.discourse.org/t/how-to-transfer-data-from-plugin-to-app-views-templates/81528/2 "2018-02-28T02:19:16Z")

</div>

I think you should read through this series:

> [@Developing Discourse Plugins - Part 1 - Create a basic plugin](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-1/30515):
>
> Building a plugin in Discourse can be really simple, once you learn a couple of quirks. The goal of this post is to create a skeleton plugin and introduce you to the basics. Your development environment Make sure you have a development environment of Discourse running on your computer. I recommend you use [the appropriate setup guide](https://meta.discourse.org/tag/dev-install) and come back when you’re done. plugin.rbtada Use [GitHub - discourse/discourse-plugin-skeleton: Template for Discourse plugins · GitHub](https://github.com/discourse/discourse-plugin-skeleton) to create a complete di…

Pretty sure it is covered, you want to use the preload store here and then load it up on the client to avoid a double web request.
