Multiple Choice in Transformation - transformation

Trying to add multiple choice category in a transformation. If there are multiple categories, I need to show them inline, separately, not run together (see second listing in image url). I was able to remove the |, but it does not list them separately.
Here is my code:
<div id="NewsFeed">
<div class="newsbox">
<%# IfEmpty(Eval("Category"), "", "<span class='category'>" + Eval("Category").ToString().Replace("|"," ") + "</span>") %>
<div class="newslist-item">
<h4 class="news-title"><%# Eval("NewsTitle") %></h4>
<p class="news-date"> <%# GetDateTime("NewsReleaseDate", "MM/dd/yyyy") %></p>
<p class="news-summary"><%# Eval("NewsSummary") %> </p>
<p class="readmore">Read More
</div>
</div>
</div>

Related

Bootstrap select menu styling not combining with ruby

I have the following bit of code, I am trying to insert my ruby code into the select to create the standard drop-down selection. The code works however the styling it really shit.
<%= form.label :housing_size %>
<div class="field form-control form-group form-select pb-1">
<%= form.select :housing_size_id, options_from_collection_for_select(Housingsize.order(:value).all, "id", "value", current_user.id) %>
</div>
<p class=" open-text pt-1"> Please select a housing size </p>
image of styling issue i have

how to "Each do |article|" but after every n-articles it has to start in a new row(foundation)

I got this Rails blogs app and for the indexpage where the articles are posted it shows a short version of the article.
<%= render 'layouts/header' %>
<%= render 'layouts/topbar' %>
<div class="contentnews">
<%= render 'layouts/bannerad' %>
<div class="row">
<% if current_user.try(:admin?) %>
<%= link_to 'Nieuws toevoegen', new_article_path, :class => "button ala" %>
<% end %>
</div>
<div class="row">
<%= render 'overview' %>
</div>
</div>
The overview-partial :
<div class="articlebox ">
<div class="large-4 columns">
<% #articles.reverse_each do |article| %>
<div class="articlebox2">
<div class="articleindex">
<%= link_to article.title, article %>
</div>
<div class="articlebody">
<%= article.short.to_s.html_safe %>
</div>
</div>
<% end %>
</div>
</div>
The problem is that this way all the articles end up in one row. I want it to show the short articles inline on the page and after every two or three article it has to start in a new row with again two or three short articles.
Anybody got any idea?
You don't actually need to create a row every n-elements. With foundation just wrap all the elements in a row, and give them columns class:
<div class="articlebox">
<div class="large-4 columns">
<div class="row"> <!-- Wrap in a row -->
<% #articles.reverse_each do |article| %>
<div class="articlebox2 large-6 columns"> <!-- Give a column and width class here -->
...
</div>
<% end %>
</div>
So you can nesting grids with foundation, and creating new rows is not necessary, foundation will just wrap if the elements exceeds the grid.
If you actually really want to create rows, you can have a look at the method each_with_index API and then insert row elements if index % 2 == 0. But this is unnecessary complexity.

asp conditional include error Microsoft VBScript compilation error '800a0400'

I followed Martha's suggestion here:
if page is default then include if not default then
And I am missing something, as I can't get it to display the slider.
Here is the slider code, and how I am using Martha'e suggestion.
This is the slider (bootstrap carousel) code (to be integrated with Martha's suggestion)
<div class="jumbotron">
<div class="container">
<div class="row fz-slider-wrap">
<div class="col-md-4 fz-slider-caption">
DFD Fioriere
</div>
<div class="col-md-8 fz-slider-image">
<div id="fz-gallery-slider" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#fz-gallery-slider" data-slide-to="0" class="active"></li>
<li data-target="#fz-gallery-slider" data-slide-to="1"></li>
<li data-target="#fz-gallery-slider" data-slide-to="2"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img class="fz-img-box" src="images/slider/03.jpg" alt="slider 1" />
</div>
<div class="item">
<img class="fz-img-box" src="images/slider/01.jpg" alt="slider 2" />
</div>
<div class="item">
<img class="fz-img-box" src="images//slider/06.jpg" alt="slider 3" />
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- .jumbotron -->
This is what happens:
If I put the above code inside
<%
Sub DisplaySlider()
slider code
%>
<%
End Sub
%>
I get this error when loading default.asp
Microsoft VBScript compilation error '800a0400'
Expected statement
/afz_includes/jumbotron.asp, line 3
If I wrap slider code in ' I get same error but line 4
If I wrap slider code in " I get same error (line 3)
I also tried to wrap each line of slider code with ", and chnaged the " of classes and ids to ', but keep getting th error.
Here is what I put on the default.asp, and the other pages
<!-- #include virtual="/afz_includes/slider.html" -->
<%
scriptname = Request.ServerVariables("Script_Name")
If InStr(scriptname, "default.asp") > 0 Then
DisplaySlider
Else
Response.Write "<div class='fz-v-spacer-top'></div>"
End If
%>
I am not sure if it was a typo, anyhow I tried to save the slider both as html, and asp, but same error.
It looks like you've put the slider's code inside the ASP code delimiters (the <% and %>), so the compiler is trying to treat it as VBScript, which it obviously isn't.
In ASP classic, you put your server-side VBScript code inside <% %> blocks. HTML code does not go inside those blocks, unless you're Response.Write-ing it.
<%
Sub DisplaySlider()
%>
<div class="jumbotron">
<div class="container">
...
</div>
</div><!-- .jumbotron -->
<%
End Sub
%>

Values are not showing using Rails 3

I want to display data inside text field and those values will be fetched dynamically.But i am not getting any value(only blank filed is coming) when show action is executing.
Please check mu code given below.
Views/posts/show.html.erb
<p id="notice"><%= notice %></p>
<p>
<b>Name:</b>
<input type="text",value="<%= #post.name %>">
</p>
<p>
<b>Title:</b>
<input type="text",value="<%= #post.title %>">
</p>
<p>
<b>Content:</b>
<input type="text",value="<%= #post.content %>">
</p>
<%= link_to 'Edit', edit_post_path(#post) %> |
<%= link_to 'Back', posts_path %>
Please help me to resolve this issue.
Replace the value Property by removing quotes as:
<input type="text",value=<%= #post.content %>>

What is the Xpath expression that involves multiple exclusions?

Suppose I have html like this:
<div id="wrap">
<div id="content">
<span>some content</span>
<div id="s1">
<p> some text </p>
</div>
<h2 id="sec1">
<span> some text </span>
<p> some text </p>
</h2>
<h2 id="sec1">
<span> some text </span>
<div> some more text </div>
<p> some text </p>
</h2>
<h2 id="sec2">
<span> do not select me some text </span>
<div> do not select me some more text </div>
<p> do not select me some text </p>
</h2>
<h2 id="sec3">
<span> do not select me some text </span>
<div> do not select me some more text </div>
<p> do not select me some text </p>
</h2>
</div>
</div>
What is the XPath expression that selects all text node except those that are under h2 id=sec2 and h2 id=sec3 ?
Literally, "all text node except those that are under h2 id=sec2 and h2 id=sec3":
//text()[not(ancestor::h2[#id='sec2' or #id='sec3'])]
However I suspect that you don't really want that, because you would be losing the <span> and <p> structure. Would it be correct to infer that you want to select all the child elements of the content <div>, except for the <h2>s whose id's are sec2 and sec3? If so,
/div/div[#id = 'content']/*[not(self::h2 and (#id = 'sec2' or #id = 'sec3'))]
But you should also be aware that the text content of the <h2> element is merely the title of a section, not the whole text of the section. So it looks like by putting div's and p's inside an h2, you are not using it the way it is designed.
All elements under an <h2> (except …):
//h2[not(#id = 'sec2' or #id = 'sec3')]/*
All <span>, <div> or <p> elements anywhere (except …):
//*[self::span or self::div or self::p][not(parent::h2/#id = 'sec2' or parent::h2/#id = 'sec3')]
alternative notation (note the parens and the slightly changed predicate):
(//span|//div|//p)[not(parent::h2[#id = 'sec2' or #id = 'sec3'])]

Resources