MVC2 and Google Custom Search - asp.net-mvc-2

I am trying to incorporate google custom search in my MVC2 application. I have already registered for google custom search and obtained API key and other settings. I have an input type textbox on my view and a search button. How can now i pass the search string (from my textbox) to google API and receive the search result and show them on same or other view page? any related post, example would be a great help.

Implementing Search in ASP.NET width Google Custom Search looks like a pretty good match. As long as you don't do his conversion of the form markup Google provides to the form runat="server" webforms style markup it should work fine in an MVC context.

Related

Using spfx webparts, would there be a way to either programmatically send an email which has a link to open a modal or using flow?

I want an spfx made webpart that I've made be able to send an email (I'm using IEmailProperties at the moment) which provides a link to a modal form?
For example:
User clicks button in webpart, form loads.
User fills out form and submits it to SP list.
Form sends email on submission. Email has a link to the actual item created, so when the user clicks the provided email link, it opens up the modal form.
I would presume that the user would HAVE to be sent to the SP page where the webpart is unconditionally, but would it be possible to open up the modal corresponding to the SP list item?
Is this feature available in SharePoint framework, because if it isn't, compared to something like InfoPath 2013 or PowerApps it's quite a limitation.
I've researched this with several shallow Google searches and on gitHub for any premade stuff, but alas there is nothing that I've spotted.
I've been told IT IS possible:
"Yeah, they’d have to visit the page. Email clients don’t do JavaScript so you can’t really do interactive stuff there. If you want to take them directly to a page that then displays a modal, that’s plenty possible though. (e.g. display the modal based on if the URL contains a certain string)"
But wouldn't know how to do the above, can anyone start me on the right path?
Regards,
T
In the email, pass a query string containing the item ID/list ID etc of the item, then have the webpart read the See: How can I get query string values in JavaScript? If your values exist. If they do exist, then open the modal using some kind of framework like bootstrap or fluent UI. You can write your own form using PnPjs or use an iframe potentially to display the OOTB edit form.
Additionally, you can link to any page in SharePoint provided you use an extension instead of a webpart to host the modal. You can install extensions tenant wide, and have it listen for the query string.

Google Custom Search - filter data from within a page

I am using Google Custom Search to enable users to search within my website. I have one page that displays a list of references (to scientific publications) as well as other content (dynamic). I would like to display the results so that references including the search term are filtered into their own tab - but I can only see how to label a whole page, not just a section of a page. This means I can filter for 'references', but get other content in my results, not just the references. Is there a way of doing this?
Yes, its possible I suppose. And I had done it sometime back and it had worked as expected. Have a look at these links -
Tech Republic Set up Google Custom Search and
Google Custom Search

Symfony2 get search via forms and links

In Symfony 2 I tried to create a little search engine. The search consists of a form and some links (like facets on solr). I managed to set up the search form with form binding, creating special searchobject class in entitiess and all this via form post request. For purpose of saving previous searches I saved the complete search object in session serialized.
My question(s) would be:
How to use get requests with a form without outputting form name? Is using forms via get valid in Symfony 2? What is the best practice?
Many sites made with Symfony 2 I see are using www.url.com/search?q=thequery&param2=xxx.
If it's valid, how would I prefill the form? Are there some examples to look at?
(PS: if using the form the way it works now, the url stays the same eg. www.url.com/seach)
Just try to change you html form declaration to specify method="GET".
And that's all, you can create your form as usual. :)

Google Custom Search Element: Styling Ads

I added a Google Custom Search Element to my website. I already modified the look and feel of the CSE to my website, but I can't modify the look of the ads element since it is inside an Iframe.
Does anybody know how to set-up the style of the ads Iframe? I want do put in a background color and change the font.
Thanks!
This feature seems to be available only for Google Site Search customers. If you are one, you'll be able to recieve your search results as an XML feed, and apply a presentation layer on the raw data. All the details on how to do this are available at the official Google Custom Search site.
You can try this api for AdSence search - https://developers.google.com/custom-search-ads/docs/implementation-guide?hl=en , but you can't make ads view like search results.

How to set content type to html on Google Calendar api?

So reading the google calendar api (php) documentation it states:
"...content, set using setContent, provides additional information about the event which appears when the event details are requested from within Google Calendar. Optionally, the description's mime-type is set using setType to specify HTML instead of plain text. "
I've been trying to figure this out for a really long time but i have no idea how to go about setting the content to html instead of plan text. I tried using the setType method, on Zend_Gdata_Calendar object, but it said the method doesn't exist. Any ideas?
In the API there is a section that talks about "Creating web content events." That shows an example of setting the type, which is just a MIME type. For HTML, you can set the type as "text/html" and then provide the link to the HTML.
Data API Developer's Guide: PHP
From reading it, I believe this will create an iFrame that shows your content. I've been playing around with this a lot in .NET and it seems to work. I hope this helps you.