customize opencms carousel element - content-management-system

opencms provides carousel element. but as per my requirement i need a carousel with thumbnail(which is not available in opencms). do i need to make changes in carousel.jsp(in com.alkacon.bootstrap.formatters/formatters). if it is the right way then provide some documentation regarding customization of carousel element.
<div class="carousel-inner">
<c:forEach var="item" items="${content.valueList.Item}" varStatus="status">
<div class="item<c:if test="${status.first}"> active</c:if>">
<cms:img alt="" src="${item.value.Image}" scaleType="2" scaleColor="transparent" scaleQuality="75" noDim="true" cssclass="img-responsive"/>
<div class="carousel-caption">
<c:if test="${item.value.Headline.isSet}">
<h3 ${item.rdfa.Headline}>${item.value.Headline}</h3>
</c:if>
<p ${item.rdfa.text}>${item.value.Text}</p>
</div>
</div>
</c:forEach>
</div>

Related

Protractor finding a popup element in a web UI

I'm trying to hover the mouse over a given element so that the help balloon appears. I need help finding the element to take action on.
I'm new with protractor. I have the docs in front of me and I've also reviewed many SO postings regarding protractor and element finding. By and large I'm doing ok, but I have one that's a bit complicated and eluding my newb ability.
I've tried many variations of by.className(), by.css() and either it finds multiple elements, or None. The acp-help-circle appears 6 times in the given UI. I'm only sharing a snippet of the code (for brevity sake of course).
<ng-include src="'OtherSettingsTemplate'" class="ng-scope"><div class="nok-content-panel panel panel-default ng-scope ng-isolate-scope" is-collapsed="true">
<div class="panel-heading ng-scope util-clickable" ng-class="{'util-clickable':contentPanel.collapsable}" ng-click="contentPanel.headerClick($event);">
<i ng-show="contentPanel.collapsable" class="toggle-icon icon-states acp-caret-bottom" ng-class="{'acp-caret-bottom' : !contentPanel.isCollapsed, 'acp-caret-right': contentPanel.isCollapsed}" style=""></i>
<b class="ng-binding ng-scope">Other</b>
<div class="right ng-scope">
<i class="acp-help-circle ng-scope" popover-placement="left" popover-trigger="'hovertooltip'" uib-popover-html="'Doc Control and Doc Manager cannot be enabled at the same time for the same configuration. Please only enable the feature used within your Licensed Property Manager configuration.'" nok-popover="Doc Control and Doc Manager cannot be enabled at the same time for the same configuration. Please only enable the feature used within your Licensed Property Manager configuration."></i>
</div>
</div>
<div class="panel-collapse ng-scope in collapse" uib-collapse="contentPanel.isCollapsed" style="" aria-expanded="true" aria-hidden="false">
<div class="panel-body">
<div class="content-wrapper">
<form name="editApp.otherSettingsForm" class="otherSettingsForm ng-pristine ng-valid ng-scope" novalidate="">
<fieldset>
<div class="fieldsRow">
<div class="col-title">
<span class="label ng-binding">Document Control</span>
</div>
<div class="col-lef">
<nok-switch-button ng-model="editApp.configuration.otherSettings.dcEnabled" size="medium" is-disabled="editApp.configuration.otherSettings.docManagerEnabled && !editApp.configuration.otherSettings.dcEnabled" class="ng-pristine ng-untouched ng-valid ng-isolate-scope ng-not-empty"><div class="switch-button medium switch-button-off" ng-click="switchButton.toggleSwitch()" ng-class="{'switch-button-on': switchButton.on,
'switch-button-off': !switchButton.on,
disabled: switchButton.isDisabled,
readonly: switchButton.isReadonly}" style="">
<div class="switch-button-container">
<span translate="components.switch-button.onLabel" translate-values="" class="ng-scope">On</span>
<label>
<span></span>
<span></span>
<span></span>
</label>
<span translate="components.switch-button.offLabel" translate-values="" class="ng-scope">Off</span>
</div>
</div>
</nok-switch-button>
</div>
<div class="col-right">
</div>
</div>
<div class="fieldsRow">
<div class="col-title">
<span class="label ng-binding">Inky</span>
</div>
<div class="col-lef">
<nok-switch-button ng-model="editApp.configuration.otherSettings.inkyEnabled" size="medium" class="ng-pristine ng-untouched ng-valid ng-isolate-scope ng-not-empty"><div class="switch-button medium switch-button-off" ng-click="switchButton.toggleSwitch()" ng-class="{'switch-button-on': switchButton.on,
'switch-button-off': !switchButton.on,
disabled: switchButton.isDisabled,
readonly: switchButton.isReadonly}" style="">
<div class="switch-button-container">
<span translate="components.switch-button.onLabel" translate-values="" class="ng-scope">On</span>
<label>
<span></span>
<span></span>
<span></span>
</label>
<span translate="components.switch-button.offLabel" translate-values="" class="ng-scope">Off</span>
</div>
</div>
</nok-switch-button>
</div>
<div class="col-right">
</div>
</div>
<div class="fieldsRow p-t-10">
<div class="col-title">
<span class="label ng-binding">Doc Manager</span>
</div>
<div class="col-lef">
<nok-switch-button ng-model="editApp.configuration.otherSettings.docManagerEnabled" size="medium" is-disabled="editApp.configuration.otherSettings.dcEnabled && !editApp.configuration.otherSettings.docManagerEnabled " class="ng-pristine ng-untouched ng-valid ng-isolate-scope ng-not-empty"><div class="switch-button medium switch-button-off" ng-click="switchButton.toggleSwitch()" ng-class="{'switch-button-on': switchButton.on,
'switch-button-off': !switchButton.on,
disabled: switchButton.isDisabled,
readonly: switchButton.isReadonly}" style="">
<div class="switch-button-container">
<span translate="components.switch-button.onLabel" translate-values="" class="ng-scope">On</span>
<label>
<span></span>
<span></span>
<span></span>
</label>
<span translate="components.switch-button.offLabel" translate-values="" class="ng-scope">Off</span>
</div>
</div>
</nok-switch-button>
</div>
<div class="col-right">
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
</ng-include>
Just a few of the many iterations I've tried...
element(by.className('acp-help-circle')) //finds > 1. The class is not unique.
element(by.cssContainingText('Doc Control and Doc Manager cannot be enabled at the same time for the same configuration. Please only enable the feature used within your Licensed Property Manager configuration.')) //this finds none.
Any help is appreciated
If your looking for the locator, Try any of the below locator to select help balloon
const ele = element(by.css('div.panel-heading>div>i.acp-help-circle'));
const ele = element(by.css('div.right>i.acp-help-circle'));
const ele = element(by.css('div.panel-heading>div>i'));
If you still get more than one element. Then try the below one
const ele = element.all(by.css('div.panel-heading>div>i.acp-help-circle')).get(1); //Change the index as per the index of your element in the element array.
Hope it helps you

bootstrap contact us form not working in smaller screen modes (using pull right)

I have a basic Bootstrap3 layout that looks like this:
<div class="container">
<div class="row">
<div class="col-md-4">
<h2>Section 1</h2>
</div>
<div class="col-md-4">
<h2>Section 2</h2>
</div>
<div class="col-md-4 pull-right">
<h2>Section 3</h2>
</div>
<div class="col-md-4">
<h2>Section 4</h2>
</div>
<div class="col-md-4">
<h2>Section 5</h2>
</div>
</div>
</div>
Section 3 has a basic Contact Us form, which works fine in full screen mode... But once reduced to a smaller size the user can not enter data.
When "pull-right" is removed the form funtions correctly in all size modes but then my vertical alignments with Section 4 and Section 5 are pushed down and out of line...
I need the form to work in all screen size modes and for the verticle alignment to be consistent - any help is appreciated - thanks!
From your question it is really difficult to understand what you are trying to achieve (I mean the layout) but as I see you use .pull-right class with .col-md-X and as far as I know it is a wrong approach because all .col-md-X classes have 'float: left; width: x%;' styles. Applying 'float: right' brakes your grid.
Instead you should have a look at these classes .col-md-push-X and .col-md-pull-X More info you can find in the official docs http://getbootstrap.com/css/#grid-column-ordering
UPD try this http://plnkr.co/edit/ujbqGvGwCnht9CGmKQ1r?p=preview resize plunker result window to see the result
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4">
<h2>Section 1</h2>
</div>
<div class="col-sm-6 col-md-4 col-md-push-4">
<h2>Section 3</h2>
</div>
<div class="col-sm-6 col-md-4 col-md-pull-4">
<h2>Section 2</h2>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-md-4">
<h2>Section 4</h2>
</div>
<div class="col-sm-12 col-md-4">
<h2>Section 5</h2>
</div>
</div>
</div>

Bootstrap - Keeping buttons and search box aligned

I've searched and can't find a problem similar to mine, where it's partially responsive. I have a footer with 3 buttons and a search box. I'd like for them to be aligned and spaced evenly apart, which I've got figured out. When I reduce the screen size, the buttons are responsive and stack correctly. But the search box is aligning to the left instead of centering with the buttons. Can anyone help? I had to define a width for the search box in order to keep it cosmetically similar to the buttons. I think maybe that's the problem? Please help! Here's my fiddle: http://jsfiddle.net/kEtr9/.
<footer>
<div class="container">
<div class="row navbar-inverse navbar-justified navbar-fixed-bottom row-fluid">
<!-- replaced this with above: <div class="row"> -->
<div class="col-sm-12 text-center"><!-- centers buttons when screen -->
<ul class="nav navbar-nav">
<li><button type="button" class="btn btn-sm fixed_button"><i class="icon-bolt"></i> submit bugs</button></li>
<li><button type="button" class="btn btn-sm fixed_button"><i class="icon-bolt"></i>Feature Requests</button></li>
<li><button type="button" class="btn btn-sm fixed_button"><i class="icon-bolt"></i>Contact</button></li>
<li>
<form class="navbar-form" role="search">
<div class="form-group">
<input type="text" style="width: 160px" class="form-control input-sm search-query" placeholder="Search">
<button type="submit" class="btn btn-xs" tabindex="-1">Go!</button>
</div>
</form>
</li>
</ul>
</div>
</div>
</div>
</footer>
This worked for me :-)
<input type="text" style="width: 160px; margin: 0 auto; margin-bottom: 10px;" class="form-control input-sm search-query" placeholder="Search">

Zurb's Foundation 4: How to use block grid to distribute groups of pre/postfix fields?

I'm dynamically creating forms that will have an unknown number of semantically-related text-fields that must share a row (in Foundation's sense of the word) and be distributed evenly within it. The blockgrid class seems the better option, but I can't get the pre and post fix classes to work within it.
Note: this isn't my actual code, but rather a generalized form of the problem to increase community utility
<ul class="large-block-grid-<? echo count($choices);?> row"> <!-- $choices = array of fields-->
<h6><span data-tooltip class="has-tip" title="">TooltipText</span></h6>
<li class="row collapse">
<div class="small-9 columns">
<label for="inputA">
<input type="text" id="inputA" name="inputA" placeholder="val" />
</label>
</div>
<div class="small-3 columns">
<span class="postfix radius">PostFix Label A</span>
</div>
</li>
<li class="row collapse">
<div class="small-9 columns">
<label for="inputB">
<input type="text" id="inputB" name="inputB" placeholder="val" />
</label>
</div>
<div class="small-3 columns">
<span class="postfix radius">PostFix Label B</span>
</div>
</li>
</ul>
I end up with postifixes that are taller than their corresponding fields and problems with the left margins/padding (see screen cap). Anyone?
Eventually, I figured out my issues. Description of solution first, then the (slightly) improved code below:
1) the <ul> element isn't a row in Zurb's sense, and applying the "row" class was buggering up the margins; it should have been in one.
2) left align was broken because block-grids should, it turns out, be nested inside the usual grid; adding a wrapping <div> with a n-column class fixed it.
3) can't wrap <input> in <label> tags if it is to be paired with a postfix (this is what causes the height problems on the postfix <span>; may just be that I can't have the field nested inside a block-level element at a different level than the <span> element it's paired with; I just deleted the <label> elements and was happy enough to have resolved the problem).
The code:
<!-- note that I've now wrapped everything in a column-classed div -->
<div class='large-12 columns'>
<ul class='large-block-grid-*'> <!-- * = php's count on an array of fields-->
<h6><span data-tooltip class='has-tip' title="">TooltipText</span></h6>
<li class='row collapse'>
<div class="small-9 columns">
<input type='text' id='inputA' name='inputA' placeholder='val' />
</div>
<div class="small-3 columns">
<span class='postfix radius'>PostFix Label A</span>
</div>
</li>
<li class='row collapse'>
<div class="small-9 columns">
<input type='text' id='inputB' name='inputB' placeholder='val' />
</div>
<div class="small-3 columns">
<span class='postfix radius'>PostFix Label B</span>
</div>
</li>
</ul>
</div>

Twitter Bootstrap: Stop input field extending beyond well

I'm having trouble trying to resolve this issue. The docs say that I should set the span equal to the parent span, however, it extends to the right outside of the well container when I do that. It looks fine when viewed on mobile (extends the appropriate amount to the right, filling the well), however, it doesn't play well on desktop (I want the fields to extend inside the well).
<div class="container">
<div class="row">
<div class="span4 offset4">
<div id="login-panel">
<div class="well bordered clearfix">
<div class="text-center">
<div class="page-header" style="border-bottom: none; margin: 0;">
<img src="library/img/logo-01.png"/>
</div>
</div>
<form method="POST" action="#" accept-charset="UTF-8" class="pull-left">
<legend>App name</legend>
<div class="control-group ">
<!-- username field -->
<div class="controls">
<label>Email</label>
<input class="span4" type="text" name="email" value="" id="email" placeholder="Your email address">
</div>
</div>
<div class="control-group">
<label>Password</label>
<!-- password field -->
<input type="password" name="password" id="password" placeholder="Password">
</div>
<div class="control-group ">
<p>
<input class="btn btn-default pull-left" type="submit" value="Sign-up">
<input class="btn btn-primary pull-right" type="submit" value="Login">
</p>
</div>
</form>
</div>
</div>
</div>
</div> <!-- end row -->
</div> <!-- end container -->
Docs are actually saying:
Use .span1 to .span12 for inputs that match the same sizes of the grid
columns.
But you want to make a full-width <input>, right?
Make an <input> to take full width
input.full-width {
box-sizing: border-box;
width: 100%;
height: 30px;
}
Also remove .pull-left from the <form>. See how it woks on this fiddle.
Edit
Since Bootstrap 2.2.0 use bundled input-block-level class to achieve this effect.
I ran into this problem recently with form and panel body. Upon inspection I noticed that the problem wasn't the inputs, but rather the form itself was extending beyond the panel. I fixed it by putting a max-width: 100% on the form instead of the input.