How do I create a link to allow users to add a specific content type when viewing a specific View.
I create a View to list all nodes of the content type "Blog". Within that View, I also want to add a link on the top to allow users to add a blog post...
For example, see the screenshot below. This is the default Blog view for the Open Outreach distribution. I can't figure out how they created a link on the type that says "Add a new blog post". In addition, I also noticed on the right side there is a block called "Content shortcuts". That block only shows up depending on the user role. In the screenshot below, the user belongs to "blogger" role so he is able to see that block. However, if I logged in as admin, I won't be able to see that block.. .
Screenshot: http://s18.postimg.org/yg47rkc7d/drupal_add_content_link.png
Comments
You can add a header(Global
You can add a header(Global text area) in your views and put simple HTML code Like: "a href="/node/add/specific content type"Add A New Content "/a .
Thanks
But the OpenOutreach didn't
But the OpenOutreach didn't use that method...
I looked at the View that openOutreach created to list all blog post. Their header and footer is blank.
You should read...
You know what to add means?
Wusel
@wusel
@wusel
I know that Krishna suggested to add the link manually in the header. I think that would resolve the problem. However, I am still trying to figure out how Open Outreach managed to add the link without manually adding the link in the header of the View.
Open Outreach did it with
Open Outreach did it with Debut Blog module/feature/app. That link is a local task added by code. You can see it in the file debut_blog.module at line 12
In Drupal 8...
It can be done like this: http://data.agaric.com/adding-action-links-pages-drupal-8
Drutopia is the Drupal 8 version of Open Outreach and we're working on bringing this feature to it also.
benjamin, Agaric