Using custom wordpress taxonomies for aktivity-streams? - wordpress

I'm working on a WordPress-Website with a project-custom post type. But the person I am doing this for, has some special, not very uninteresting questions and suggestions. I am not quite sure, weather this is possible, and if it is, than how I should do it:
I created a custom post type: projects. Its custom taxonomies are "genre"(tag), and "customer"(category). So, if you call a certain customer, you will get the customer-taxonomy page, with a little description of the customer, and all the posts, related to this customer. So far no problem, but he wants the posts to be ordered by genre. Genres means, Webdesign, Corporate Design, Printgraphics, etc..
Is it possible, to list all project-custom posts, related to the custom-taxonomy "customer", and order them by time and the custom-taxonomy "genre"?. It should look like..
Webdesign:
2012-05 - Projekt-title 2012-07 - other project title
print:
2012-04 - print project-title 2012-06 - any project-title
It is important, because He wants the Project-Posts to look like a activity-stream related to the customer, like social media services.
The other Questions is, weather I can somehow combine custom-taxonomies and standart post-taxonomies. The Idea is, to post a standard News-Article, writing about the new project Hes working on. And he wants this article to show up on the related customer page.
Is this possible? And if yes, how should I do it? If it isn't possible, is there any other good solution?

Related

Inserting a custom handler anywhere in a wordpress URL

I have some custom posts that I need to be able to list and link to at various points around a site.
They are case studies and I want to make them contextually relevant to services, which are currently just pages.
Ideally I want to be able to insert 'case-studies' into a URL, have it recognised and then either list relevant posts if there is nothing following it, or display the post based on the slug that follows case-studies.
EG:
/service1/case-studies - lists all case study posts relevant to service1
/service1/case-studies/blah displays the 'blah' case study post
In the above service1 is just a page. The URL might even be
/service1/subservice/case-studies
/service1/subservice/case-studies/blah
I'm thinking that relationships will handle the relevancy - so a case-studies listing will look up all case studies related to the slug preceding 'case-studies' in the url (so in these cases subservice or service1)
I've looked at wp-router (https://github.com/jbrinley/WP-Router) but I'm not sure how I can use the slugs preceding the case-studies marker to query for relevance.
Anyone had any luck with useful URL routing in Wordpress?

Gravity form does not correlate correctly when publishing a post

There is a problem, I do not know how to solve it.
The scheme is as follows.
There are categories of goods, in this form:
Category-1(term_id=1)<br>
subcategory-1(term_id=4)<br>
subcategory-2(term_id=5)<br>
subcategory-3(name Tour)(term_id=6)<br>
Category-2(term_id=2)<br>
subcategory-1(term_id=7)<br>
subcategory-2(name Tour)(term_id=8)<br>
https://docs.gravityforms.com/creating-a-feed-for-the-advanced-post-creation-add-on/
Gravity Forms will initially look for the category/tag of the same name as specified and use that. If no match is found, then a new category/tag will be created. All new categories/tags created this way will be placed at the top level of the category/tags hierarchy.
I tried everything in the Populate Anything settings, I can’t get it to correlate with the category that I need.I need this (subcategory-2(name Tour)(term_id=8)), inserts here anyway (subcategory-3(name Tour)(term_id=6))
By the way, I'll add one more thing.
https://github.com/gravitywiz/snippet-library/blob/master/gp-populate-anything/gppa-display-terms-hierarchically.php
It would seem that he chose the category that is needed, how to force the search not by name, but by term id?

Linklist with most recent blog at top?

I would like to have a simple linklist of blogs with their latest entry, author, blog name, and date be listed in order of latest update. So, kinda like what Blogger has on their sidebars -- whenever they have linklists, it auto-reorders based on which blog has been updated recently (though it usually doesn't have summaries, just the title of the site).
What I'd like to do is plug in multiple RSS feeds into one place that just checks the latest entry in each feed and then reorders them
The magpie plugin or RSS plugin in EE currently only allows you plug in ONE feed. It will show the latest entry per blog if I repeat the magpie tags several times (one per blog), but that doesn't help with re-ordering, and also it's a bit messy.
Help? Thoughts?
UPDATE: I want to make sure that each blog is still featured even if the last post they've done is a year ago. A blog like that will be the last in the link list for example, while an entry/site updated this hour will be at the top. So for example, if I limit the linklist to 5, it's not going to show the 5 most recent entries, period, from just one site if that one site updated 5 times in one hour. It will show 1 recent entry per site.
Sample behaviour: like the Flickr Friends Page sorted by date and 1 photo per person. http://www.flickr.com/photos/friends/ Except this time, just titles of blog posts and the site they belong to, author, etc.
There is an RSS Aggregator EE Add-on available which combines feeds for you
http://devot-ee.com/add-ons/rss-aggregator
{exp:rss_aggregator:items feed_ids="6|7" limit="10" order_by="pub_date" order="desc" pub_date_format="m-d-Y g:ia" cache_timeout="60"}
<li>
{title}<br />
<small>{pub_date} - From {channel_title}</small><br />
</li>
{/exp:rss_aggregator:items}
You could do this using Yahoo! Pipes. In fact, I created one a bit ago: http://pipes.yahoo.com/pipes/pipe.info?_id=82e8b23b84bf2d6c3014f50c0f6b2f1d
Just call it with a comma-delimited list of RSS feeds and voila! It gives you the latest entry for all the RSS feeds, sorted in reverse chronological order.
Example:
http://pipes.yahoo.com/pipes/pipe.run?_id=82e8b23b84bf2d6c3014f50c0f6b2f1d&_render=json&feedurls=appleinsider.com.feedsportal.com/c/33975/f/616168/index.rss,feeds.foxnews.com/foxnews/latest?format=xml
So now that you have the feed's URL, you can pull out the individual entries using the REST module from Phil Sturgeon.
For those interested, here's how the pipe is setup:
Fairly sure Stash could handle this via set_list and get_list. I haven't tested this but perhaps something like:
{exp:channel:entries channel="feed_urls"}
{exp:magpie url="{url}" limit="1"}
{items}
{exp:stash:append_list name="feed_items"}
{stash:title}{title}{/stash:title}
{stash:pubdate}{pubdate}{/stash:pubdate}
{/exp:stash:append_list}
{/items}
{/exp:magpie}
{/exp:channel:entries}
{exp:stash:get_list name="feed_items" orderby="pubdate"}
<h3>{title}</h3>
<p>{pubdate}</p>
{/exp:stash:get_list}
https://github.com/croxton/Stash
What about using an entries loop with multiple channels, pulling lastest from that and stashing it. Then get the stash in the RSS feed? I think that would work.
You could probably do it with Datagrab because it lets you import XML feeds into your own site and then you'd be able to order them as EE channel entries.

Create a Drupal view that loads all articles that share any one taxonomy term (Contextual Filters)

I have a custom article type that contains a list of taxonomy terms
For example articles can be tagged with a location and possibly multiple topics.
On any given article's display page I would like to be able to pull a single view that gives a list of other articles that share any of of the taxonomy terms.
If an article was tagged with the topics of recipes & chicken as well as the location of new york I would like my single view to present the five most recent articles that share any one of the above tags.
The taxonomy terms have been added to the articles in the form of new fields of either the "Term reference" or "Node Reference" type. (field_topic, field_location)
I know that I have to somehow use a Contextual Filter, but I am having some trouble figuring out how to set and debug my "default argument".
I suspect that I've got to choose:
Taxonomy term ID from URL
Load the default filter from the node page
Do something with PHP code
I'm really struggling to get this displaying anything, and I can't even see a way to debug to find out what the values I'm getting are.
Can anyone help figure this out? Even some guidance on the right direction to look would be welcome at this point.
You can do this in just clicks if you have Drupal 7 and Views 3 (You already have this I'm sure).
Your configuration is correct so far.
Choose " Provide default value " as action to take if arg is not given.
Choose Term ID from URL"
Check "Load default filter from node page, that's good for related taxonomy blocks"
:)
this will load term IDs from the current node's term reference field if arguments are not given.

Sorting grouped nodes by taxonomy term

Ok, here's the problem:
I have a list of contacts, which i have created in views, that are grouped by taxonomy terms like so:
(term:) Staff:
(node:) John Doe
john#doe.com
(node:) Jane Doe
jane#doe.com
(term:) Management:
Fred Doe
fred#doe.com
and so on...
As it is now, i have no idea what decides the order of the taxonomy terms (ie: why is the 'Staff' nodes coming before the 'Management nodes').
So what i need to do is to be able to sort the order of the terms, and also the order of the nodes in each 'category' (or what you would call it).
I have tried to sort the terms by weight, but the only thing that happens is that i get duplicated nodes output, and nothing happens with the order of the actual terms.
As for the order of the nodes, i was thinking that maybe a hidden CCK-field with some sort of weight, but i dont know. But the biggest problem is still the order of the categories.
If anyone has an answer to this it would be very helpful.
Thank you.
EDIT:
Strange, i tried that before i asked the question, but now it seems to work. However i still get duplicated nodes when i sort by taxonomy weight, for some reason. I really need to get rid of those. Heres how my view setup look, if its any help:
Fields: taxonomy=all terms (limited to one vocabulary)
image attach content
Sort criteria:
Taxonomy weight:descending
Filters: Taxonomy term id(with depth) // to filter out what page it belongs
Node type : contact
node published : yes
dont know if that information helps at all
/Anders
The solution is simple, in views you can sort your result by the taxonomy term. You have 3 options as default.
From the views interface:
Term Taxonomy terms. Note that using this can cause duplicate nodes to appear in views; you must add filters to reduce the result set.
Term ID The taxonomy term ID
Taxonomy Weight The term weight field
The sorting in views, is located in the top right corner, and gives a wealth of options as to how you want to sort your results.
Edit:
Duplicates is a known problem with taxonomy terms. The problem is that if a node has two terms that fit it will be included once for each term. When you use the taxonomy term filter, you can reduce duplicates, which should fix your problem:
http://grab.by/16vw
I seldom have sort problems with views, but I have to admit it's not something I ever really focused on. Here's a short list of things you might wish to check. If that doesn't solve, it would be great if you could provide some more detail on your settings and what appears to be the default sorting in your current configuration.
How did you set the sort criteria in the views UI? You have basic settings available there (top right of the UI panel). See below for some screenshots that should help you finding your way around the configuration.
How did you set your taxonomy term order (accessible from somewhere similar to: http://example.com/admin/content/taxonomy/3 - where the number is the taxonomy ID).
Here is some more information on sorting capabilities of views.
Screenshots on how to configure sorting
NOTE: In this example I show how to sort nodes according to whether they are published or not, but the procedure applies equally for taxonomy terms.
In this view I already set up some sorting, add yours by clicking on the + button
alt text http://img15.yfrog.com/img15/7118/screenshot005vy.png
Select what kind of content you want to sort
link text http://img3.yfrog.com/img3/2341/screenshot006jkz.png
Select the information you want your content to be sorted by
alt text http://img3.yfrog.com/img3/4816/screenshot007nt.png
And finally select the direction of sorting!
alt text http://img37.yfrog.com/img37/9806/screenshot008ah.png
Now you should be good to go! :)
Hope this helps!

Resources