Meta Tags in Google Site Search - meta-tags

I'm planning on implementing a google site search (and paying for it so I can get access to the XML). One thing I am wondering about is the possibility to use custom meta tags in it.
I've heard yes from colleagues but nothing confirmed. Searching for an answer has given nothing (maybe because you cant?)
Anybody knows?
Edit: I want to be able to retrieve those meta tags from the search result to be able to provide different styling for different types of pages.

Yes, you can do this, although not, as far as I know, using meta tags. Instead, google allows you to put custom attributes inside your HTML, which can then be retrieved from the XML you get back from Google Custom Search results API.
Take a look at
http://code.google.com/apis/customsearch/docs/snippets.html for more info on how this works. The Structured Data section outlines the specific ways you can stick custom metadata inside your page so Google will hand it back to you along with each search result. The easiest seems to be a PageMap, which is an HTML comment inside your HEAD, like this:
<!--
<PageMap>
<DataObject type="document">
<Attribute name="title">The Biomechanics of a Badminton Smash</Attribute>
<Attribute name="author">Avelino T. Lim</Attribute>
<Attribute name="description">The smash is the most explosive and aggressive stroke in Badminton.
Elite athletes can generate shuttlecock velocities of up to 370 km/h.
To perform the stroke, one must understand the biomechanics involved,
from the body positioning to the wrist flexion. </Attribute>
<Attribute name="page_count">25</Attribute>
<Attribute name="rating">4.5</Attribute>
<Attribute name="last_update">05/05/2009</Attribute>
<Attribute name="thumbnail">http://www.example.com/papers/sic.png" width="627" height="167" />
</DataObject>
</PageMap>
-->
If you absolutely must use META tags, the Bing Search API does support indexing all meta tags whose NAME property starts with "Search.", e.g.
<meta name="Search.MyCustomProp" content="Hola mi amigo Google, I want my META!">
Then in the Bing Results API you can pull out all these values using the WebResult.SearchTag property. When issuing the request, you'll either need the WebRequest.SearchTags Property or you can just add text to your search query, e.g. poodle meta:search.MyCustomProp(amigo) searches for the word "poodle" on pages where the search.MyCustomProp meta tag contains the word "amigo". Using the Bing API is free as long as you stay under 7 queries per second and adhere to some other restrictions detailed here.
Sorry to be talking so much about Bing, feel free to ignore that part-- but I have had reasonably positive experiences using the Bing API at a previous job.

Can you detail more about the meta tags you want to use. You can add meta tags and it should not matter to Google.

Related

Ms Dynamics CRM custom workflow get visible attributes from form using c#

How to get visible attributes from entity form using c# in custom workflow?
Any idea please share!
It's a PITA but it's doable.
retrieve the form you want to process from the systemform entity (you want the formxml attribute)
the formxml attribute contains the form definition, it's encoded (< is written as < and so on) xml format.
Inside the formxml contents, a field looks like this:
<cell id="(guid)" labelid="(guid)" showlabel="true" locklevel="0" visible="false">
<labels>
<label description="(field label)" languagecode="1033" />
</labels>
<control id="(field name)" classid="(guid)" datafieldname="(field name)" disabled="false">
parse the xml, looking for cell elements which do not have visible attribute (it's only there if the field is hidden)
you might have to narrow the list down through further searches in xml (not 100% positive about what i.e. a subgrid would look like) but I have no direct experience with this kind of logic so I can't pinpoint each and every corner case
Pain point: You won't be able to tell if a field visibility has been toggled through javascript
What do you mean visible attributes? You mean attributes with a value or attributes showed in the form? If it's the second the only way that you have to keep track of that is use a text field and use some code to identify what is active.
ex. create a text field
and write in it all the fields that are visible ex name and surname:
"name","surname"
You can manipulate this with javascript and business rules to keep the list of fields updated at every time for each record. In the code behind you just need to read for the text field and manipulate the magic string.
It's not a really nice operation, but is the only way i can see to keep track of what fields are shown on the form.

Orchard content items not appearing in dashboard

The context for this is Orchard 1.8.1 running on an Azure Website (not cloud service) with Azure database.
I've defined a ContentType via the admin UI. The 'Class' type is creatable and not draftable, and contains Autoroute, Body, and Title parts, along with Numeric and Taxonomy fields. The Taxonomy is defined with its terms.
Items can be created via the 'New' menu on the Admin page or via 'Create New Class' from the Content Definition list. I've created a Query and Projection to display all items of type 'Class', and that shows all of them properly on its front-end page.
The problem is in the 'Content' section of the admin page. If I create the item via the 'New' menu, it doesn't appear in the Content listing. If I create it via 'Create New Class' in the Content Definition list, it does appear in the Content listing. But all of them show up in the query.
I've exported the items and reviewed the XML ... nothing different. The following is an item that appears in the Content list:
<Class Id="/alias=american-history" Status="Published">
<NumericField.Credits Value="1" />
<TaxonomyField.Dicipline Terms="/alias=subjects\/social-studies" />
<BodyPart Text="<p>This American History course will integrate both Social Science skills with historical content of America and the United States from the early 1600s to the present, as well as education in government and economics. There is a strong emphasis on college preparation, civic participation, and integration with research and technology. Students use will a variety of resources and activities to explore major themes, including the changing face of American society and the United States&rsquo; changing role in the world.</p>" />
<AutoroutePart Alias="american-history" UseCustomPattern="false" />
<TitlePart Title="American History" />
</Class>
And this is an example of one that does NOT appear:
<Class Id="/alias=economics" Status="Published">
<NumericField.Credits Value="1" />
<TaxonomyField.Dicipline Terms="/alias=subjects\/social-studies" />
<BodyPart Text="<p>The introductory economics course has a strong emphasis on personal finance. Students learn the importance of budgeting and how, through a variety of financial instruments, to make money work for them. Students also learn how the stock market operates by participating in a virtual stock game. In this context, students are introduced to the concepts of stock ownership, the commodities market, supply and demand and the different types of business structures. Students learn how to complete various tax forms and the how's and why's of the American tax system. Students will read the book, Freakonomics, and gain insight on how to look at problems from an economic standpoint. Finally students learn about the different types of economic systems, the circular flow of money through the economy, and government intervention in our economy.</p>" />
<AutoroutePart Alias="economics" UseCustomPattern="false" />
<TitlePart Title="Economics" />
</Class>
I started digging through the database to see if I could find the problem, but quickly got lost.
Any idea where I might start looking for the issue? I'm thinking that, if this were a bug, it would have manifested well before I found it and would be causing a hue and cry, so I'm thinking it's something in my setup somewhere.
Thanks for any help I can get on this one.
-- Michael
You need to add the common part for it to appear in the contents list because it needs that to order by date and probably some security stuff related to who owns the content, though I'm not sure about that one :)
Update from Bertrand: You also need to mark the content type as Listable in the Content Type definition.

How can I make an Amazon Associates book recommendation based on a set of words?

I have a website which has headlines on a broad set of topics from architecture to gadgets to oceans to robots. I would like to put an Amazon book recommendation on each page, based on a set of words associated with the current topic.
So, for instance, the oceans page might have word [shark, marine, coral, ocean...]. I want a widget that will recommend one or more books based on that set of words.
Thanks
I would suggest you to take a look at the ItemSearch operation, available through Amazon's Product Advertising API. To get books about sharks, the request would look like:
http://webservices.amazon.com/onca/xml?
Service=AWSECommerceService&
AWSAccessKeyId=[AWS Access Key ID]&
Operation=ItemSearch&
Keywords=Shark&
SearchIndex=Books
&Timestamp=[YYYY-MM-DDThh:mm:ssZ]
&Signature=[Request Signature]
This would return an XML response containing a list of books related to your keyword(s):
<TotalResults>200</TotalResults>
<TotalPages>20</TotalPages>
<Item>
<ASIN>0691120722</ASIN>
<ItemAttributes>
<Title>Sharks of the World</Title>
...
</ItemAttributes>
</Item>
<Item>
<ASIN>1604330074</ASIN>
<ItemAttributes>
<Title>The Shark Handbook</Title>
...
</ItemAttributes>
</Item>
you should then have no problem parsing that response and creating links for your page.

Changing the Sort order on BDC Actions in SharePoint

We have a number of Actions defined in a BDC (Business Data Catalog) definition in SharePoint, and need to change the order they are displayed in the UI.
Within the Action defintion, there is a Position field, which we are specifying, however, the UI wants to display everything in Alphabetical order, which isn't what we are after.
An example of the Position section of the BDC Definition is shown below.
Do you know how this could be achieved successfully ?
<Action
Position="10"
IsOpenedInNewWindow="true"
Url="http://www.google.co.uk/search?q=%22{0}%22"
ImageUrl="/_layouts/1033/images/TAH/Google.gif"
Name="Google for Assured Name">
<ActionParameters>
<ActionParameter Index="0" Name="assured_name" />
</ActionParameters>
</Action>
(PS I did consider putting this on SuperUser, but there is no BDC there, and there are a number of BDC related questions on here, so here it is... ;) )
You could do through the naming of your actions, for example:
01 This is the first action
02 This is the second action
A bit of a hack, but it should work.
There is no MSDN documentation for the Position attribute other than verifying its existence (see Action documentation) but it seems reasonable to assume that it should do what you require.
I suspect that the lack of documentation is due to this feature not being fully implemented.
Something that may work is to add leading spaces in the Name attribute. If BDC does not strip these spaces automatically you could use it to cause the alphabetical ordering to do what you require (the more leading spaces you have, the further down the list the action will appear). When rendered as HTML the spaces will likely be stripped.

Content Query Web Part and Deleted Occurrences of Events

I have a content query web part showing 3 events for todays date on our Intranet homepage. However, when a user deletes an event from a recurring series, SP changes the title of that event to "Deleted: [original title]". My content query web part still shows these and I don't see a way to filter them out.
For my list views I get around it with a field and a formula in that field of the following.
=IF(ISNUMBER(FIND("Deleted:",Title)),"Yes","No").
However, that field isn't available to me within the CQWP filter drop-down.
how does one prevent these deleted occurrences from showing in a CQWP?
UPDATE: This is a publishing page BTW.
While you can perform the filter via XSLT, it may be preferable to do so in the CAML query itself. This article from Microsoft, How to: Customize the Content Query Web Part by using Custom Properties, shows how the CAML Where clause is constructed (and may be modified). Good luck!
Have you tried the DataFormWebPart (DFWP) before? It is basically the most basic of databound webparts, but strangely the most customizable as well.
To try it out, open SharePoint designer and create a dummy aspx page to work on / play around with. Then open the datasources pane and find the list you want to use. then click on that list and select "view data". Drag the appropriate fields onto the aspx page. You now have a (very) basic grid displaying your data.
The cool thing is though, all layout is xsl driven, so completely customizable. You can even make the xsl reusable by switching to source view and cut and paste the xs,l into a separate xsl file. To then use this file instead of the inline xsl, after moving the inline xsl, change the DFWP property xsl (that contained the inline xsl) from
<xsl><!-- .... this is where the moved inline xsl used to be... --></xsl>
to
<xsllink>/server relative url to xsl file</xsllink>
The only remaining problem is that the DFWP's datasource is now bound a single list. To do roll-ups cross site collection (if you have say multiple event lists you want to include), you need to change the DFWP's SPDataSource's select query and datasourcemode. How to do that is explained here.
Now to address your actual question: (after my blatant plug of the underappreciated DFWP :-D) The DFWP's SPDataSource basically uses either an SPQuery or an SPSiteDataQuery (depending on the datasourcemode) to retrieve the data, and you can do way more filtering wise. Either in the CAML query itself or by just filter out the unneeded rows using something like the following:
<xsl:if test="not(contains(#Title, 'Deleted:'))">
<xsl:apply-templates />
</xsl:if>

Resources