Adding profile2 profile to panel in drupal7 - drupal

I am building a social networking site with drupal 7.32.I am using Profile2 module for user profiles.I have added fields to the default profile type.Now, I want to display the profile on the right side of the two column stacked layout of the panel.After creating the panel pages and on the last screen where the layout appears when I click on the gear and add content the next screen asks for node id which I am not able to fill.What should be the node id ? I am in a fix.
Any and all help would be appreciated.

Are you using the Page manager? Add the "currently logged in user" to the context and you should get the ability to add personal information to the page.
Another way to go is to create a view with a contextual filter to the currently logged in user. The view can then later be displayed on the panels page (without context).

Related

Wordpress backend design

I have to build an "admin only" page where an admin user can input 3 objects - a person's "name", "description" and a photo. this way they can add/edit/delete people from the website.
I have tried adding "add_menu_page()" to the admin navigation menu and that worked, but I'm kind of lost as to what to do next, or even if I'm on the right track.
I'm assuming I will load the people into the WP database and query the database when i need to display each person.
Yes you are on the right track. Just create a form for the admin where he/she can enter the name, description and photo of a person.
You should make another page using the same method i.e. add_menu_page() and load your WP DB there and provide the option to the admin to delete, edit or add from there.

Admin/Customer Roles (ASP.NET)

I'm currently working on a website that is for a restaurant. I have created everything I need to but I'm confused on one part:
I have created two roles: Admin and Customer. I have a page that displays a menu.
My main problem is, how would I display this page to the customer as a simple menu page, and how would I display this page to the admin where he would be able to edit the items within the database?
Would I need to create two different pages, one for a standard customer and one for the admin, or could it be done through the sitemap, where a link (the edit menu page) is visible/invisible based on the user who is signed in? (How would I accomplish that?)
You can write your custom code for this, as you have yourself created two roles. you can use the following steps
1) Create form authentication ticket for your roles on login and add it so that you'll be able to authenticate user/roles and write authentication rules in web.config.
2) either create two different page for admin and customer or you can use single page that renders differently based on the role, if you creates a single page make sure you should hide secure admin menu items at server side itself so that it will not be rendered and thus no change can be made at client side for security reason or just add items based on roles dynamically always.
Let me know if you need more details.

Drupal 7 View to list content created by logged in user

I've just started using D7 and was trying to set up a system where people can add a couple types of content and associate one with the other via nodereference.
I only want users to be able to see and work with their own content.
To achieve this in D6 I used a view for nodereference.
In D6 I used argument : user: uid and if there is no arg, it uses the user id of the logged in user. This would return all of the content that was authored by the user.
I haven't been able to figure out how to do this in Views 3?
got it:
you first need to add a User relationship, then you will see new filters and contextual filters - one of which is "current user" or something like that
This five minute video shows how to do it, as well: http://nodeone.se/sv/node/684
With contextual filters you can also display the list as a tab on each user page (as shown in the screencast).
If you're interested in a list that always shows the current user's posts, you can use a standard filter instead – there is a "current user" filter available.
Edited: The original link is broken. I'm not sure which video it was, but it could be one of the following (which all deal with this topic).
https://vimeo.com/22276809 Video guide
https://vimeo.com/33588889 Exercise description
https://vimeo.com/33588956 Exercise solution
For drupal 7
Steps for doing as the above question are
Create a new content view and limit it to the content type you want.
Uncheck "Create a page" and check "Create a block." Select the format you want; I recommend an HTML list of linked titles. Click "Continue & edit."
Add a contextual filter for "Content: Author uid."
Under "When the filter value is not available," select "Provide a default value," and select "User ID from URL" from the dropdown. Because blocks don't understand contextual filters very well, the view won't work properly without this default value, and all posts of the given content type will show on all user pages (not just the user's own posts).
Under "When the filter value is available or a default is provided," check "Specify validation criteria" and select "Basic validation" as the validator. Select "Hide view" from the dropdown.
Save your view.
Assuming that you created a block display, the block will now be available on the Blocks page. Go there and open it.
Set your block to display on all user pages (/user/*) in the correct region. Save the block.
Your block should now appear on all user pages, showing the content written by each user.
Source

How I can add "files available for download" to Drupal user profile page

first time here. I have searched all day for my particular issue with no luck.
I have users that have specific roles auto generated (they purchase a game). I want to display files available to their particular role on their user profile page. I just want to know how I can add a generic view or associate a panel with user profile pages. I want this to display for every user, not on a per user basis. Basically it'll act like, say, direct2drive, you log in and go to your user profile basically and see what games you bought. Seems simple but I am having a heck of a time figuring out how to do this.
I am pretty used to using views but I just don't get how to edit the user profiles like I want to.
Thanks!
The simplest way is to install views_attach, and create a view with a Profile display. This displays the View on the user profile pages, rather than on its own page or in a block, and will pass the user's uid to the View as an argument.
Alternatively, if you're already using comfortable using panels, you can go to admin/build/panels and enable the Users panel. This replaces the user profile page with a panel, which you can add views, nodes and blocks to as normal.

How do I add items in Primary Links automatically as soon as some user publish new content

I am building a website www.etutornetwork.com, in top menu I have included a link to a new content type [services]. I want to add a link in dropdown menu as soon as I publish new content in services.
Please Help, Thanks in advance.
and one more question, I dont want to give any name to one of the menu in the site. I tried using or leaving it blank, but it does'nt like this.
You can attach it in node creation time (see Menu fieldset), or use module like Auto Menu. Some more details about this module (from its project page):
The Auto Menu module automatically generates menu entries on node creation/edition. Parent menu item can be specified on a per content type basis.
This module acts when the menu section of a node is left empty only. So, users can still organize menus manually. Moreover, default setting for content types is to not create menu items automatically.
I use Taxonomy Menu, to create my secondary menu. It is very flexible to use. Some more details about this module (from its project page):
Features
Custom Menu per vocabulary
Uses the default taxonomy term path or custom paths
Integrate with Views
Integrate with Pathauto: use URL/path aliases
Does not interfere with other menu modules
You can take away the permission from users dealing with menus. Then when you are publishing submitted content from them, you can assign them a menu entry and control the title.
Other than that, you could use Views (since Services is a content type) to create a block that lists all Services with links directly to the node.
Either way, someone will have to title the nodes/menu items. It's easier administrative wise to remove menu permissions from users submitting content.

Resources