<data:post.title> returns title of blog and not post title - post

Hi I'm trying to convert a static html and css design to a blogger template. I've run into an issue where i expect the post includable to return the post title but instead is returning the blog title. Here is the includable code for the post and below it is the include code that is called in the main includable that houses the html structure. Please any ideas as to how i might resolve this would be very grateful.
<b:includable id='post' var='post'>
<!--Article Summary-->
<b:if cond='data:post.title'>
<h1 class="article-title">
<data:post.title/>
</h1>
<b:else/>
<h1 class="article-title">
<data:post.title/>
</h1>
</b:if>
<p class="posted-by">
by
<em class="author-name"><data:post.author/></em>
on
<span class="date"><data:post.dateHeader/></span>
</p>
<p class="article-content">
<data:post.body/>
</p>
READ MORE
</b:includable>
<b:if cond="data:blog.url == data:blog.homepageUrl">
<div class="article-summary">
<img class="article-image" src="https://lh3.googleusercontent.com/article-main-image.jpg" alt="article-main-image"/>
<b:include name="post"/>
</div>
</b:if>

is correct, so instead I'd be curious about whether or not you're including from the right place. For example, are you in the MOBILE section vs the NON-MOBILE section of the template?

Related

create relative links with Thymeleaf

I have the following code which loops through a list of countries and creates a href links
<div class="container" th:each="country: ${countryList}">
<a th:href="${country.countryAbbr}"><div clss="row" th:text="${country.country}"></div></a>
</div>
The current page url is "localhost:8080/directory", and the generated url is showing as
"localhost:8080/us"
How can I make the url show as "localhost:8080/directory/us"
I want "us" to be added to the current url of the page.
Try create the following code in your Controller class.
#RequestMapping(value="/", method=RequestMethod.GET)
public String rootGet() {
return "redirect:/directory";
}
You can use ServletUriComponentsBuilder:
<div th:with="urlBuilder=${T(org.springframework.web.servlet.support.ServletUriComponentsBuilder)}"
class="container" th:each="country: ${countryList}">
<a th:href="${urlBuilder.fromCurrentRequest().path(${country.countryAbbr}).toUriString()}">
<div clss="row" th:text="${country.country}"></div>
</a>
</div>
Give a try to this one
<div class="container" th:each="country: ${countryList}">
<a th:href="#{${country.countryAbbr}}"><div clss="row" th:text="${country.country}"></div></a>
</div>
Using # usually resolves the default context but I am not aware of your environment.
For example, if you had Tomcat .war file, and your application would be hosted at localhost:8080/myApp, you would want result /myApp/us rather then /us. # would do that trick.
If above is not relevant for you, use this one:
<div class="container" th:each="country: ${countryList}">
<a th:href="#{'/directory/' + ${country.countryAbbr}}"><div clss="row" th:text="${country.country}"></div></a>
</div>

Not able to get the title of of frame using ng-bind

I am working on Geb Spock framework for AngularJS application. When I am trying to get the title of framework its returning the value as null. For more details please refer the below html code for it.
<modal-header class="ng-scope ng-isolate-scope" ng-show="zaakAanmakenView.indicatieIntake" cancel="cancel" titel="intake.aanmaken.header">
<div class="modal-header mb5" style="cursor: pointer;">
<h2 class="modal-title">
<span class="ng-binding" ng-bind="modalHeader.titel | translate">Create new intake</span>
<span class="ng-binding" ng-bind="modalHeader.titel2"></span>
</h2>
<span class="close-popup" ng-click="modalHeader.cancel()">X</span>
</div>
</modal-header>
I tried below thing:
intakeScreenTitle(wait:true){$("span", "ng-bind": contains("modalHeader.titel | translate"))}
intakeScreenTitle.text()
Can you please help me to get the title as "Create new intake".
Thanks for your help.
Have u tried with
intakeScreenTitle(wait:true){$("span", "ng-bind": "modalHeader.titel | translate")}
May be there is another span which contains the same ng-bind.

Check if .NET MVC Sitemap exists

I am using
<div class="row">
<div class="col-lg-12 breadcrumb" >
#Html.MvcSiteMap().SiteMapPath("")
</div>
</div>
to display the sitemap of current page. How do i check if the Sitemap exists for the Current page and then only display it?
like:
#if([Check Exists]){
<div class="row">
<div class="col-lg-12 breadcrumb" >
#Html.MvcSiteMap().SiteMapPath("")
</div>
</div>
}
By default, the SiteMapPath HTML helper already does this check. If there is no node that corresponds to the current request the SiteMap.CurrentNode property will be null. When that happens, no HTML will be output from the SiteMapPath HTML helper.
If that isn't good enough to cover your particular use case, you can use the built-in FilteredSiteMapNodeVisibilityProvider, a custom visibility provider, or security trimming to hide the nodes you don't want visible.
Failing that, you could create a custom partial view template for the SiteMapPath or create a custom HTML helper based on the SiteMapPath if nothing else meets your needs.

MODX Articles: Can't retrieve article image with getResources

I am running MODX Revo 2.3.2 with Articles and getResources. On my start page, I wan't to show the 4 most recent articles by calling getResources. However, it does not show the image. Tried to output it without phpThumbof, but it does not work out at all.
[[getResources?
&parents=`11`
&tpl=`articleRowTpl`
&includeTVs=`1`
&processTVs=`1`
&showHidden=`1`
&limit=`4`
]]
My articleRowTpl looks like this:
<article class="blog-item blog-full-width">
<div class="blog-thumbnail">
<img alt="" src="[[+tv.articleImage:phpthumbof=`w=750&h=200&zc=1`]]">
</div>
<div class="blog-full-width-date">
<p class="day">[[+publishedon:strtotime:date=`%d`]]</p><p class="monthyear">[[+publishedon:strtotime:date=`%b %Y`]]</p>
</div>
<div class="blog-content">
<h4 class="blog-title">[[+pagetitle]]</h4>
<p>[[+introtext:default=`[[+content:ellipsis=`400`]]`]]</p>
Mehr lesen...
</div>
</article>
There are no errors, it just does not output the image path. I double checked the placeholder and the prefix, which defaults to tv. as the documentation says.
Alright, found it. I just removed the TV-Prefix of getResources with
tvPrefix=``
and now I can access the TV with [[+articleImage]].

#content $key= vs #if in dust

I have the following code:
{#data.merchantModel}
<div class="address">
{#content $key="content:combinedAddr" merchantAddress1="{merchantAddress1}" merchantAddress2="{merchantAddress2}"/}
</div>
{:else}
<div class="address">{merchantAddress1}</div>
more code...
{/data.merchantModle}
I'm working with Webcore/NodeApp but everything after the {:else} doesn't get rendered. If I comment it out everything is fine. Not sure why webcore doesn't like the {:else} but was wondering if there's another way to write the above code?
Still trying to wrap my head around dust.
Looks like you need to close your content tag and model is misspelled on the closing tag:
{#data.merchantModel}
<div class="address">
{#content $key="content:combinedAddr" merchantAddress1="{merchantAddress1}" merchantAddress2="{merchantAddress2}"/}
</div>
{:else}
<div class="address">{merchantAddress1}</div>
more code...
{/content}
{/data.merchantModel}

Resources