1

I am new to Drupal and I am working on a page created by the Views module and I am displaying my content as a grid.

As I already know it is possible to add content to my specific content type from the admin panel, I would like to have a front page which has the same functionality.

Is there anything which helps me achieve this?

3

You can simply go to achieve Using the 'Admin Menu': Configuration > Site Information.

Under the Front Page section, change FRONT PAGE to content add information.

I think you should look into

Form Block module.

Enables the presentation of user registration, site wide contact, or node creation forms in blocks. This is particularly useful for including forms on panels.

Advanced Form Block module.

Create any number of blocks with a particular node edit form.

Create any number of blocks with a particular node add form of a content type.

Create as many blocks as you like of each kind.

1
  • You are most welcome. – DRUPWAY Oct 28 '16 at 11:30
0

Another approach is to display a special (informational) message on your specific page where you want to have this functionality (= "add content to my specific content type") available. And eventually only show such message to users with a specific role (eg an administrator).

To do so, all you'd need is to enable the Rules module, and create an extremely basic custom rule which looks like so (in Rules export format):

{ "rules_show_a_message_on_a_specific_path" : {
    "LABEL" : "Show a message on a specific path",
    "PLUGIN" : "reaction rule",
    "ACTIVE" : false,
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "init" : [] },
    "IF" : [
      { "user_has_role" : {
          "account" : [ "site:current-user" ],
          "roles" : { "value" : { "3" : "3" } }
        }
      },
      { "data_is" : {
          "data" : [ "site:current-page:path" ],
          "value" : "path\/to\/my\/page"
        }
      }
    ],
    "DO" : [
      { "drupal_message" : { "message" : "Click \u003Ca href=\u0022[site:url]\/node\/add\/article\u0022\u003Ethis link\u003C\/a\u003E to add some content of type Article ..." } }
    ]
  }
}

If you have the Rules UI enabled, you can simply import the above rule in your own site (and enable the rule afterwards, which is disabled as shown above).

Here is what the above rule actually does:

  • Check if the currently logged in user has access to role "administrator" (which corresponds to role id = "3").
  • Check if the current path is path/to/my/page.
  • If both checks (= Rules Conditions) are satisfied, then the Rules Action will be performed, which is to display a message like "Click this link to add some content of type Article ...", whereas this link is actually an hyperlink to /node/add/article.

If needed, just adapt the values for the role id, the current path, and the actual message (including the URL in it and or the used content type) to fit your own needs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.