Create custom search form indexed_search TYPO3 v8 - typo3-8.x

I'm trying to add a custom search form into my template, the TypoScript I used in a v7 install no longer works.
If I copy the Fluid form used in the extension (Form.html) and place it into one of my Fluid template a search box appears but it posts back to itself, even though I have set a rootPidList in my constants. This is the code I copy:
<f:form action="search" method="post" id="tx_indexedsearch" pageUid="{settings.targetPid}">
<div class="tx-indexedsearch-hidden-fields">
<f:form.hidden name="search[_sections]" value="0" />
<f:form.hidden name="search[_freeIndexUid]" id="tx_indexedsearch_freeIndexUid" value="_" />
<f:form.hidden name="search[pointer]" id="tx_indexedsearch_pointer" value="0" />
<f:form.hidden name="search[ext]" value="{searchParams.ext}" />
<f:form.hidden name="search[searchType]" value="{searchParams.searchType}" />
<f:form.hidden name="search[defaultOperand]" value="{searchParams.defaultOperand}" />
<f:form.hidden name="search[mediaType]" value="{searchParams.mediaType}" />
<f:form.hidden name="search[sortOrder]" value="{searchParams.sortOrder}" />
<f:form.hidden name="search[group]" value="{searchParams.group}" />
<f:form.hidden name="search[languageUid]" value="{searchParams.languageUid}" />
<f:form.hidden name="search[desc]" value="{searchParams.desc}" />
<f:form.hidden name="search[numberOfResults]" value="{searchParams.numberOfResults}" />
<f:form.hidden name="search[extendedSearch]" value="{searchParams.extendedSearch}" />
</div>
<fieldset>
<legend><f:translate key="form.legend" /></legend>
<div class="tx-indexedsearch-form">
<label for="tx-indexedsearch-searchbox-sword"><f:translate key="form.searchFor" />:</label>
<f:form.textfield name="search[sword]" value="{sword}" id="tx-indexedsearch-searchbox-sword" class="tx-indexedsearch-searchbox-sword" />
</div>
<div class="tx-indexedsearch-search-submit">
<f:form.submit name="search[submitButton]" value="{f:translate(key: 'form.submit')}" id="tx-indexedsearch-searchbox-button-submit" class="tx-indexedsearch-searchbox-button" />
</div>
</fieldset>
And my typoscript:
config.index_enable = 1
page.config.index_enable = 1
plugin.tx_indexedsearch.settings.targetPid = 31
If I add the stock indexed search plugin to a random page, this will work.
Just to rule it out, I've also disable realurl just in case.
Thanks again T3 community.

if you just copy the search template into your output/ page template, there is no plugin available which provides values for the specific variables needed in this template-part.
either you use an output of a page where you have inserted the plugin (copy from HTML-source)
or you insert the plugin in all pages:
this can be done with a column you inherit and where the plugin is inserted on top level
or you use typoscript to render the plugin into a fluid-variable and display the generated HTML in your (page-)template.

Related

Using Validation Tag Helper in ASP.NET 5

I have an ASP.NET 5 app. I'm creating this app as a learning exercise on a Mac. Currently, I'm trying to use the validation tag helper. In my view, I have the following code:
<form method="POST" action="~/account/login">
<h1>Login</h1>
<div class="validation" asp-validation-summary="All" />
#Html.ValidationSummary(false, "", new { })
<input id="Username" name="Username" />
<br />
<input id="Password" name="Password" />
<br />
<button type="submit">Login</button>
#Html.AntiForgeryToken()
</form>
The traditional #Html.ValidationSummary(...) approach works. However, the <div class="validation" asp-validation-summary="All" /> approach does not. I want to break away from using the tradition #Html. approach and use tag helpers as much as possible.
Why won't the validation results appear in the asp-validation-summary?
Thank you!
Since this commit
the ValidationSummaryTagHelper takes a value of the ValidationSummary enum instead of a string
So you need to write:
<div class="validation" asp-validation-summary="ValidationSummary.All" />
See also in the sample on Github.

Why Do I get Entity & in url formed with spring:url

I am working with Spring MVC and I need to create a url with two parameters:
<spring:url value="/test" var="myUrl" >
<spring:param name="param1" value="1" />
<spring:param name="param2" value="2" />
</spring:url>
I get this: myUrl = /test?param1=1&amp ;param2=2 (note that this url have a entity &amp ; inside)
and when I put this url in a href=${myUrl} this don't work like I want.
Though, If I use c:url and c:param I get that I want :
<c:url value="/test" var="myUrl">
<c:param name="param1" value="1" />
<c:param name="param2" value="2" />
</c:url>
myUrl = /test?param1=1&param2=2
What is the problem with "spring:param" ? Do I need to configure some parameter in my Spring mvc configuration?
Thanks.

Plone Search: get method to pass via URL to another site

I am using Plone 4.3 and the diazo bootstrap theme and want to use the site-search-form to pass the searchterms including two search-options to another site (catalog) via get method.
To achieve this I have modified the plone.searchbox template and changed some content of it:
<div id="portal-searchbox"
i18n:domain="plone"
tal:define="navigation_root_url view/navigation_root_url;
search_input_id view/search_input_id;">
<form id="searchGadget_form" method="get" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" action="http://www.thecatalogadress.net/opensearch">
<div class="LSBox">
<input name="LOCATION"
type="hidden"
value="HAGENBIB" />
<input name="SG1.SG.HAGENBIB:SGHagenvk"
type="hidden"
value="on" />
<input name="QUERY_alAL"
type="text"
size="18"
value=""
title="Finden"
class="searchField" />
<input class="searchButton"
type="submit"
value="search"
i18n:attributes="value label_search;" />
<div class="LSResult" id="LSResult"><div class="LSShadow" id="LSShadow"></div></div>
</div>
</form>
</div>
By now the search term is passed, but the two input-options are not introduced in the URL thus the query in the catalog doesn't work.
The result I need as URL is http://www.thecatalogadress.net/opensearch?LOCATION=HAGENBIB&SG1.SG.HAGENBIB:SGHagenvk=on&QUERY_alAL=test
As I am new to plone I wanted to ask for a hint, where to look at or what to change in order to add the two input-options to the URL.
I think you're probably forgetting to add the proper ZCML directives for the override on the template take place.
Take a look at this tutorial on Overriding Viewlets.

What is the best way to display repeated codeblocks in vb.net?

I'm quite new to asp.net and vb.net, so my apologies if I do not use the correct terminology here.
I have a database table and for each row in a returned dataset from that table I want to produce some HTML code eg:
<div>
<img src="SOURCE" />
<h1>Row1</h1>
<input type="button" />
<input type="button" />
</div
<div>
<img src="SOURCE" />
<h1>Row2</h1>
<input type="button" />
<input type="button" />
</div
What would be the best way to do this? Do I simply pull back an object with the entire data and then write a foreach loop to iterate through each row and insert a string to the page, or should I be looking to use a user control?
I guess I'm trying to make a sort of forum listing page and want to fetch all topics with a particular entry in a database and then display this list on a page with some input controls and an image. I also want to add pagination; so to show only 10 posts at any time and then be able to paginate to the next page.
Again I apologise if I've not been very clear, but I'm having a little bit of a hard time understanding the best way to tackle this.
You could use a Repeater.
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<img src="SOURCE" />
<h1>Row<%# Container.ItemIndex %></h1>
<input type="button" />
<input type="button" />
</ItemTemplate>
</asp:Repeater>
If you want any code block to be repeated. Try this code which i uses..
Sample code to display any div 3 times
<% For i as Integer = 1 To 3%>
<div>
<img src="SOURCE" />
<h1>Row1</h1>
<input type="button" />
<input type="button" />
</div> <% Next %>

transit to next page from casGenericSuccess page using link in jasing cas single sign on

I want to navigate to my added jsp page from casGenericSuccess.jsp but I am not able to transit to next page using hyperlink.
What i did is:
changes in login-webflow.xml
<view-state id="viewGenericLoginSuccess" view="casLoginGenericSuccessView">
<transition on="userManagement" to="userManagementHome" />
</view-state>
default_views.properties
userManagementHome.(class)=org.springframework.web.servlet.view.JstlView
userManagementHome.url=/WEB-INF/view/jsp/default/ui/userManagementHome.jsp
casGenericSuccessView.jsp
<jsp:directive.include file="includes/top.jsp" />
<div id="msg" class="success">
<spring:message code="screen.success.header" />
<p><spring:message code="screen.success.success" /></p>
<p><spring:message code="screen.success.security" /></p>
<a href="login?_flowExecutionKey=${flowExecutionKey}&_eventId=userManagement">User Management
</div>
<jsp:directive.include file="includes/bottom.jsp" />
Also I tried changing href to login?&_eventId=userManagement
I have my userManagementHome.jsp at same place where casGenericSuccess.jsp is present.
can someone please help me out navigate to my page.
Right now it is not navigating and displays the same casGenericSuccess.jsp page on click of user management link.
Try with execution instead of _flowExecutionKey

Resources