Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Liferay 7.2 - Change CSS for Search Container
Hi,
I have the following Search Container on my view.jsp:
And in my META-INF -> resources -> css I have the following main.scss file:
I am successfully hiding the thead of the Search Container, but for some reason I can't change anything else. What would be the correct way to edit the appearance of the Search Container?
I have the following Search Container on my view.jsp:
<liferay-portlet:renderurl varimpl="iteratorURL">
<portlet:param name="mvcPath" value="view.jsp" />
</liferay-portlet:renderurl>
<% List<myobject> myObjects = (List<myobject>) request.getAttribute("objects-list"); %>
<liferay-ui:search-container cssclass="search-container" delta="10" deltaconfigurable="true" emptyresultsmessage="Empty results!" total="<%= myObjects.size() %>">
<liferay-ui:search-container-results results="<%= ListUtil.subList(myObjects, searchContainer.getStart(), searchContainer.getEnd()) %>" />
<liferay-ui:search-container-row classname="MyObject" modelvar="myObject">
<liferay-ui:search-container-column-image name="Avatar" src="${myObject.avatar}" />
<liferay-ui:search-container-column-text name="Name" property="name" />
</liferay-ui:search-container-row>
<liferay-ui:search-iterator />
</liferay-ui:search-container></myobject></myobject>And in my META-INF -> resources -> css I have the following main.scss file:
.search-container thead {
display: none;
}I am successfully hiding the thead of the Search Container, but for some reason I can't change anything else. What would be the correct way to edit the appearance of the Search Container?
HI,
I am successfully hiding the thead of the Search Container, but for some reason I can't change anything else. What would be the correct way to edit the appearance of the Search Container?What exactly your not able to change ?
Hi Mohammed,
I was not able to change the background color of the td elements. I noticed that my main.scss was opening the text editor of my PC. I changed to main.css and the file is opening in the IDE now. Looks now that my css changes are taking effect, could be a problem loading the scss file? I have the following working on my css:
I was not able to change the background color of the td elements. I noticed that my main.scss was opening the text editor of my PC. I changed to main.css and the file is opening in the IDE now. Looks now that my css changes are taking effect, could be a problem loading the scss file? I have the following working on my css:
.search-container thead {
display: none;
}
.search-container td {
border: none;
}
.search-container td:first-child {
width: 5%;
}
.search-container td:last-child {
width: 95%;
}