kalamuna / playbox

A playground for ambitious would-be code artists.
http://live-playbox.at.kalamuna.com/
GNU General Public License v2.0
5 stars 29 forks source link

In playbox_admin get the favorite president and favorite boss to be the ones displayed at the top of the the /presidents and /robots #88

Closed pirog closed 9 years ago

pirog commented 9 years ago

So now that the admin can set a favorite president and a favorite boss we should have those settings actually do something. An easy thing first thing would be having the president/robot picture that appears at the top of /presidents and /robots to be set using these settings.

To do this we will need to hook into views. Here are a list of views hooks that could be helpful https://api.drupal.org/api/views/views.api.php/group/views_hooks/7

Basically we should have the two views displays for this show a random president UNLESS the favorite robot/president setting is set.

pirog commented 9 years ago

Before the view is built you will want to get rid of the random sort and add a filter containing the node id in the relevant variable... but only if it exists of course.

katypool-zz commented 9 years ago

@pirog ok so these "technically" "work" now, but I cheated by changing the views config in features. So the behavior for when a variable is not set is not right (it displays a default president/robot instead of a random one). More work to be done! Perhaps we can discuss this issue when you return if I haven't cracked it by then

pirog commented 9 years ago

quotes around "technically" and "work" certainly inspire significant levels of confidence :)

yeah lets def go over it monday!!!!!!