Skip to main content

Related posts. Looping with Multiple Labels

Enhancing the Related Posts code, we will now move on with Loops on multiple labels. It's advised to read Related posts with multiple conditions and then continue to read this post to understand things better.

<!--See related posts appear only if required-->
<b:if cond='data:post.labels any (label => label.name in [&quot;Blogger Customizations&quot;,&quot;Blogger Tricks&quot;])'>
<b>See related posts:</b>
</b:if>

<!--Un-ordered list tag begins-->
<ul>

<!--This loop should be passed with Labels to be filtered for Related posts-->
<b:loop values="data:post.labels filter (label => label.name in [&quot;Blogger Customizations&quot;,&quot;Blogger Tricks&quot;])" var="label">
        <li><a expr:href='data:blog.homepageurl + &quot;/search/label/&quot; + data:label.name'><data:label.name/></a></li>
</b:loop>

</ul>
<!--Un-ordered list tag begins-->

This loop takes care of linked lists and fits into all kind of posts. All we need to do is find the label name and added it in two places as highlighted in green.

Therefore, a third label can be added like below(yellow highlighted) and the code will look like,

<!--See related posts appear only if required-->
<b:if cond='data:post.labels any (label => label.name in [&quot;Blogger Customizations&quot;,&quot;Blogger Tricks&quot;,&quot;Custom Domains&quot;])'>
<b>See related posts:</b>
</b:if>

<!--Un-ordered list tag begins-->
<ul>

<!--This loop should be passed with Labels to be filtered for Related posts-->
<b:loop values="data:post.labels filter (label => label.name in [&quot;Blogger Customizations&quot;,&quot;Blogger Tricks&quot;,&quot;Custom Domains&quot;])" var="label">
        <li><a expr:href='data:blog.homepageurl + &quot;/search/label/&quot; + data:label.name'><data:label.name/></a></li>
</b:loop>

</ul>
<!--Un-ordered list tag begins-->

This will workout well and the number of lines of code is considerably reduced.

Comments

Feeds for you

Blogger profile confusions

Since Google has closed it's social networking service called the Google+ for consumers, few products has some effect on it. One of them is our very own blogger.

We could see that update notification in our blogger dashboard as below,



Besides from the things gone as mentioned in Blogger's official blog post here -> An update on Google+ and Blogger, we have a confusion on profile that needs to be clarified. That is the reason why I am writing this down.

There are now two profiles,

Blogger profileGoogle profileBlogger profile - Where does this appear?
This appears in all of your blogs if you have your profile gadget added. You can see that on this blog in the top right, How do I update this profile? Go to blogger.comNavigate to Settings > User settingsClick Edit under Blogger in User profile sectionYou'll be navigated to https://www.blogger.com/edit-profile.g where you can edit your profile that appears on the blog.Google profile - Where does this appear?
This appears in…

How to secure your Google account and Blogger blog?

As a part of contributions to NCSAM, I am writing this article down on what all should we be aware of with respect to Google's security aspect and how to make sure your blog stays yours forever.
What is NCSAM? It's National Cyber Security Awareness Month which is observed during the month of October every year in America.

However, we all know cyber security is a world topic and is not limited to just the USA. So let me give some tips with respect to keeping the Google account safe and Blogger blogs safe from hackers.

As I secure my account, I hope you people catch up too.

In this blog post, I am going to tell about the following,
Securing your Google account.Securing your Blogger blog. Securing your Google account Since Blogger is also part of your Google account, let's first see what all we need to do to keep our Google account safe. Don't share your password to anyone.Keep changing your password every 60 - 90 days.Make sure your password is strong enough. Have at leas…

Blogger in Draft says "Try the new Blogger!"

It's been long time that I wrote something here. Interestingly there seems to be a new update in Blogger in Draft (https://draft.blogger.com).