0

How does one create the said Redirect a Users Name (Link) to a User Homepage in Panels Using Rules.

Here is my scenerio:

I have a Panels set which will show a subject posted content page in the left panel and the right panel will show a Dynamic list of users in a View, ultimately related to the subject page (ie by ZIP/Postcode, but thats for later).

I wish the View of usernames to then allow the reader to click the said users name (maybe pulled from Profile2 field name link) and take it to a Users (from the said Views) 'about' Homepage. I have pre-designed as a Content (custom) Node template page in the backend Structure for displaying the Users 'homepage'. (the said user will have priviledges to edit/amend via their DB, but that's for later). I'm thinking that this can be done via Views and presumed that a custom Rules Component needs to be created, but I'm stumbling at the next stage hurdle as to "what/where". I'm not sure if I would need to create a dedicated 'node' or whether it can simply be done via a View and if the Relationship elements come into for it to show dynamically to the end browsing user. Later, the Views will also incorporate Location map nodes (ala Google M), but for now I'm happy with an end result showing a static homepage which would have the normal 'about us' text, photo image, 'Contact Us' etc, ala the old Myspace type page.

I have viewed many of Johan Falks' tutorials at http://vimeo.com/nodeone but am still stumped about my approach or whether I'm missing a further module component?

I'm sure this is very basic stuff, but any clarificiation on this process for a learning novice is appreciated. Thanks.

  • I have an inclining that after watching vimeo.com/28422176, the answer lies in a 'Relation' to both the user's profile details and a custom Node template to show the Biog home page. This could be likened to an article page about say rock venues/local rock bands with a list of current local bands related to the article (via say, a venues' ZIP/postcode) and the dynamic View showing local rock bands in that area; which the reader can then click a 'link' to find out more on the band on their 'biog' page. If you understand my meaning. – Paul B May 6 '13 at 21:43
0

So, you want to make the username link to a different page?

You can do that by overriding theme_username e.g, in template.php

You could also use hook_preprocess_username for the theme preprocess function and also change the entity_uri for the user entity, though the first option is probably simplest.

  • Thanks for your reply, I would rather attempt to use a Relation/Rules/Views combination if that is at all possible. The way I see it now, is that by using the Relation I can create a 'directory' list in a View pane which should suffice. Provided I can get each user to only create 1 'single' node to represent their 'biog' page (based on a content type template including the relevent fields from a custom Profile2) then I can use Views to show the list dynamically. I presume this is the direction to take? – Paul B May 8 '13 at 10:32
  • I've managed to get a View to show the dynamic list of required users to show within my Panel. The list shows the required Users name as a link and successfully links to a User as Profile, but I require it to output the link to a custom made Node Page. I've tried 'output as link' in the Views Panel, but am having no joy, can somebody elaborate on the process of link a Username Field as a link to then show a custom Nodepage which would include the User Profile fields (I'm fine with that)? it's the intermediate requirements. I have Relation installed, but feel I'm missing something trivial. – Paul B May 11 '13 at 11:19
0

The answer for my issues here was in the said Views block I previously created. Using the field in question (in my case the User Name to link to a Users Public Profile page), I selected "Rewrite Results" then "Output this field as a link" and added the path and [name] ([name] == User: Name) in the replacement pattern. For example if the path to a Panel page was to be "soccer-player" then I entered /soccer-player/[name] this would result in website/soccer-player/sammy (if the user to be clicked was called Sammy and it's URL was shown on a page).

Easy now I come to think of it, but a previous tutorial would have worked wonders when I need it. I hope the above helps someone in future.

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.