Passing A Variable

Sherry Collins asked on June 23, 2015 17:55

Good Day,

We have begun to customize our Work Groups and I have question. When the user clicks on Team-Up (Workgroups) they will see a two lists. One list is all the teams they belong to and the other is all the teams available. When they click on any Team Link, they will be taken to the Team's Home Page. There they will see the Team Avatar, Team Name and Team Description. I need to be able to dynamically get the Avatar/Team Name and Team Description based on whichever Team the user clicked on?

Can anyone help me on how to do this in Kentico.

Correct Answer

Brenden Kehren answered on June 24, 2015 13:54

If you're doing all of this within the content tree you can use content inheritance to do the heavy lifting for you. It would really be no different than having a locations section in your site. This is what I've done in the past for similar items:

  • Create a page type (locations) and add all the necessary fields to it, avatar being one of them
  • Create a page template and add webparts to it to display the details of the location as your design requires.
  • In this page template, we'll call it Locations Master, you'll add a repeater in place of where the image goes to dynamically get the image from the page type. You'll set the path to /{0}/{1}. This will dynamically get the actual location each time no matter what location you are selected on (as long as your path is /Location/location-1 format).
  • Also in the Locations Master page template you'll add a pages placeholder webpart. This will allow you to dynamically nest another template under it and choose to hide or show webparts on the Locations Master template by setting the show for child pages property.

This may or may not work as you'd expect for the workgroups but it gives you an idea on how it could work. Good luck!

0 votesVote for this answer Unmark Correct answer

Recent Answers


Joshua Adams answered on June 23, 2015 18:54

Pass in the id via querystring when the link is clicked and then get the items in the transformation based on the id that is passed in. I haven't used workgroups, so I am not sure if this is on the front end or back end, so if thats not an option for you...post some more information and I can come up with some different ways. You can also set a macro condition that will ooks at the querystring value aka {% itemid %} and set that on your datasource or repeater for the where clause.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.