Creating a view of users who have created nodes - drupal-6

Basically i want to creeate a block diaplay view,which displays a list of all the users thata have posted some nodes on the drupal website.

Oddly enough thinking about this right now it could be a little tricky. You have two possible solutions off the top of my head.
1 - Create a new view of item type Node. Your row style will obviously be set to Fields. Under which Fields to pull select the User group and then tick off the User: Name checkbox. Set your Items to display setting to 0 for unlimited results.
Under the preview you should get a ton of results looking something like:
Name: John Doe
Name: Mary Jane
Name: John Doe
Name: Anonymous
What you're seeing is the authors of all the nodes posted in your system. There will be duplication because a user in your system could be the author of multiple nodes. Unfortunately you can't just tick off the Distinct: Yes option because this only applies to nodes and not the users.
How to deal with the duplicate user name results tho? Custom theme your view by creating a custom template under Theme: information. Inside the template write some PHP code which intercepts the row results from the View query before it renders and only render distinct user names from the results. You'd have to write the logic though to determine whether a user name has already been added.
As simple as creating a new custom array, adding each row result (user name) to array but first checking to see whether it already exists in your custom array - if it does then toss it and move on to the next user name. At the end you'll have an array filled with distinct user names who have posted on your site.
voila! It works. It's not elegant but it definitely will work if built this way.
2 - Alternatively maybe you can get this module working to accomplish the same thing in a less complicated manner: http://drupal.org/project/views_customfield but I have never used it so I cannot comment on it.
Good luck. Hope that helps.

My solution was to:
Create a view of people
Add a UID field (and any other fields you want)
Create a theme.tpl.php file for the Row Style
Do a DB call on each loop through the row to search for nodes created by the supplied UID.
Here is what I have in my semanticviews-view-fields-VIEWNAME.tpl.php
<?php
//Query the Drupal DB for nodes associated to the supplied UID
$existing_nid = db_query("SELECT nid FROM {node} WHERE (type = :ctype) AND uid = :uid", array("ctype" => "CONTENT_TYPE", "uid" => $fields['uid']->content))->fetchField();
//If the supplied UID created content of the supplied type, then show their name
if ($existing_nid != FALSE) {
echo "Name:" . $fields['name']->content;
}
?>
This way only UID's that have content associated to it in the DB will be printed out, and those that don't, won't.
Hope that helps!

Related

How to configure WorkItem in AzureDevops for Incremented Iteration ID

I have a requirement as Below:
Create a new Work Item in Azure Devops
It should have the IterationID as 1
If I modify something in that WorkItem say "Description" it should increment the Iteration ID.
In my case, If I create a new Work Item Say "User Story", Its getting Created with the Iteration ID "2"
Though I change the Description its remains the Same.
Below Are the Detail Steps That I have followed.
Created the User story as a WorkItem
Its Get Created with Iteration ID 2
Modified The user story (Change the Description)
Still The Iteration ID Remains Unchanged
Below is the history page Of that user story.
Please let me know what configuration do I need to implement to meet the Requirements.
Thanks in Advance.
Work items are already versioned. You do not need to add a custom field for this purpose.
Look at the revision ID field. I believe it's called rev.
Additionally, "iteration" already has a meaning, so you should avoid adding an additional field that redefines the term, otherwise you are going to have terminology confusion in the future.

MS PowerApps Deep Linking

I'm passing a parameter to a PowerApp through the calling URL called ID, i.e.
https://web.powerapps.com/apps/powerappid?ID=32
When the app launches I want it to jump from BrowseScreen1 which lists all the Business Cases and go straight to the Business Case with the matching ID (a field from a SharePoint list).
I'm brand new to PowerApps but pretty sure what I need to do is called Deep Linking and I found this tutorial https://powerapps.microsoft.com/en-us/blog/powerapps-deep-linking/ and having read the comments to the article I'm trying to apply it to the OnStart property of BrowseScreen1. I don't really understand how the navigation link in the tutorial is constructed so I'm sure I'm using the wrong Navigation parameters as it always launches the first record in the list ignoring anything to do with the ID. I'm using:
If(Not(IsBlank(Param("ID"))),Navigate(DetailScreen1,
None,{ID:LookUp('Full Business Case For Review'.ID, ID =
Value(Param("ID")))}))
'Full Business Case For Review' is the name of the Sharepoint list and ID is a unique field that gets assigned to each list item.
The tutorial doesn't mention having to change anything on the detail screen but I've also wondered if I need to perhaps change the item properties there as they are currently:
BrowseGallery1.Selected
I'm feeling out of my depth and would really appreciate some help on this!
Thanks,
John
Yes, you need to change the Item property in the detail screen. This is because there is currently no way to select an item in a gallery programmatically in PowerApps.
I normally get around this by using a global variable to store the current item, so you can set BrowseSreen1.OnStart to this
If(Not(IsBlank(Param("ID"))),
Set(CurrentItem, LookUp('Full Business Case For Review'.ID, ID = Value(Param("ID"))));
Navigate(DetailScreen1, None)
)
This will store the item with ID equal to your parameter as a record type variable.
You also need to change the OnSelect property of your BrowseGallery1's template or whichever control is used to navigate to the detail screen. It will need to be something like this
Set(CurrentItem, ThisItem); Navigate(DetailScreen1, None)
Finally set the Item property in the detail screen simply to this
CurrentItem

How do I modify the Magento Search to check child skus?

Currently, the site search will search all of the skus of the items marked as being visible in search. This is all well and good.
The problem arises when the customer knows a sku of the individual child item. So, let's say a product comes in both a 20 foot and 25 foot variation. We would put those into a configurable product and have a single product page where a customer could then choose which of those two lengths.
What happens is, a customer invariably knows that the sku of the 20 ft variation is RDB-20, while the other is RDB-25. A search for RDB-25 then, comes back with no results since the simple product is not visible in search - it doesn't realize there is a match.
How do I get the search to search an item with visibility "Not Visible Individually", when it's parent is visible in search?
The desired effect is that, if a child SKU is searched for, the parent should show up in the results.
There really is no good way of doing it without extending the default search, but at that point you might as well look for other options.
Here's a workaround that might be doable depending on how you manage your products and it worked for me until I moved on from the default search.
Rather than altering the search, try adding an attribute to all products and make it hidden concatenating all the skus into this field. The search should find the text attribute and show the configurable.
Its a bit of a workaround but works for me.
This is untested, but I did a bit of perusing in our attributes and I think I found something that might help.
Currently since our child products don't show up in our search, we have the parent populate with the children product's attributes.
However, things like brand, taxable amount, description, populate for every child product while our SKU does not.
The only difference I can see between the two attributes is under manage attributes -> click on attribute -> and then under properties go to frontend properties and select
Use In Search Results Layered Navigation: YES
Used in Product Listing: YES
Use In Layered Navigation: Filterable (with results)
I'm not sure which of these do what, but in the population of the fulltext search data table, somewhere it is being told to populate for the children and I believe that the admin panel is where.
I hope this helps!

Using the search module to display entries based on custom fields

I have a profile weblog that contains all our users details (fields seperate from the membership).
These users can submit application forms with the use of a SAEF (stand alone entry form), which will be stored in an applications weblog. Inside this applications weblog, I have a relationship field which assigns a profile to an application.
Inside this application, radio buttons are contained to allow an admin to change the status of that application (an example, a judge views an application for Joe Bloggs and sets this application to “winner”).
What I essentially need to do is filter out all the profiles that have not been set to a number of status’. So if I apply for an application and the judge is yet to view this application, my profile should not appear in the search results. My idea of this is that I would somehow have to intertwine search results with a reverse related entry tag, and as my knowledge of the search module is limited I am at a complete loss if this is even possible.
As you can see, not only do I need to search by custom field, but the profiles that will be displayed should be determined on custom fields contained in the application entry.
I would suggest using the "status" option instead of the radio custom field.
Why? Because you can accomplish the same thing you want to do with the radio field and you can set what entries you want to return in your search results.
For example, you have a status group called: "Application", which is assigned to the that weblog/channel
Within the status group, you will have three options: Pending (waiting to be looked at), Loser (judge sets it to this because it is not a winner, or just as pending), Winner (judge considers that application a winner).
Then in the search tag, you would set what statuses it will return in the search results
so if you want to only return applications/profiles that were marked winner, you would set the status="status_id" (this will be the id of "Winner" status)

Sharepoint alerts not working when multiple people are in an item

We use Sharepoint Services 3.0 as a project tracking tool. We have a list set up that contains your basic information (description, etc.) plus we have a "assigned person" column that is of type Person or Group that we use to associate list items with individuals. This column supports multiple selections.
We would like to set up alerts such that each person gets an alert email only if they are assigned to a list item. The approach we have taken is to set up a view on this list that is filtered to show list items where the assigned person equals [Me], and then to create an alert on this list that is set to send an email when someone changes an items that appears in the view.
This works well when there is only one person in the assigned person column. It does not work when there is more than one person in the assigned person column.
Does anybody know why this wouldn't work, or what I can do to troubleshoot? Is there a better way to achieve the end result? We could make several "assigned person" columns and not allow multiple selections, but that seems kind of kludgy.
Try this info site,
http://www.sharepointalert.info
it has a good alert trouble shooting guide.
The reason it works for one person but not multiple people is because the check is specifically against an individual. The comparison your view does is whether Assigned is equal to [Me], not if Assigned has [Me] as one of its entities.
Instead of using a list filter of is equal to, use the list filter contains. That should do the trick.
EDIT IN RESPONSE TO COMMENTS
To access the object model, you'll need to use Visual Studio. I'm unaware of a method to accomplish this kind of thing using SharePoint Designer, but maybe there's some sort of crazy Datasheet View thing you can do. Anyway... onto your actual needs...
The following code sample illustrates a very basic method for achieving your goal.
using (SPSite site = new SPSite("yourwebsiteurlhere"))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["titleoflist"];
SPView view = list.Views["filteredviewname"];
view.Query = "<Where><Contains><FieldRef Name=\"assignfield\"/><Value Type=\"Integer\"><UserID Type=\"Integer\" /></Value></Contains></Where>";
view.Update();
}
}
Replace "yourwebsiteurlhere" with the website url, "titleoflist" with the title of your list in question, "filteredviewname" with the name of the view, and "assignfield" with the internal name that you used for your assignment field. If you created it through the standard SharePoint UI, this should be the name of the field without any spaces.
As far as where to run the code, you could put this kind of thing in a one-time workflow. I sometimes do that just to make sure I have necessary privileges. Hope this helps!
If you're not able to/allowed to use Visual Studio, then your solution will probably have to be to look into a 3rd party solution.

Resources