Adding list of the same blog posts to multiple pages in Composite C1 (Orckestra CMS) - c1-cms

I've added a blog post to my Orckestra CMS site - fine.
However, when I try and add the blog control to another page - it doesn't work.
<f:function name="Composite.Community.Blog.BlogRenderer" xmlns:f="http://www.composite.net/ns/function/1.0">
<f:param name="BlogEntriesCount" value="6" />
<f:param name="BlogListOptions" value="Show image" />
<f:param name="BlogItemOptions" value="Show title,Show image,Show content" />
</f:function>
If I add another blog page it creates a new blog.
I have added 'Blog' as an application to the new page. It doesn't work. I have duplicated the original blog page - again the blog wont show.
How can I do this?

Did you try setting the IsGlobal (labeled 'Show posts from all blogs') to true when implementing the BlogRenderer function?
If this doesn't work, you can try modifying the BlogRenderer function itself by replacing the
var entries = BlogFacade.GetEntries(IsGlobal);
with something like
var entries = "Data.Get<Entries>()
This should give you all blog entries on the site, which you can filter with lambda expressions as you see fit.
I hope this helps.

Related

Blogger Mobile Blog Posts Gadget

I have started a blog for a local group that I volunteer with so that we can communicate with the public, post information about ourselves, and provide a means for the public to get in touch with us. (www.wildwindflutechoir.com)
At the request of the organizer for the group, I have modified the "Blog Posts Gadget" so that it only shows 1 post and have removed any widgets that displayed "popular posts" or "past posts". This way only the most recent information/article is displayed on the home page and the other pages in the site (like the about-us page) don't have old posts lingering around. The main goal was to no longer display information posted about our Christmas activities on our homepage (or elsewhere in the website) now that Christmas is done...unless, of course, you browse to it through the archive links.
This works fine on desktop browsers; however, when I am viewing the website with a mobile device (or by adding the /?m=1 parameter to the URL)...the home page lists all of the posts.
I cannot figure out how to have it simply display the 1 most recent post instead of this list...Nor can I figure out how to have it automatically display the full details of most recent post (instead of a preview)
Please provide some advise on how to modify the Home page of my Blogger blog so that it only displays 1 post in mobile view (and preferably the whole post instead of a preview of it)
Update
I applied the suggested solution to hard code the number of posts shown to 1. I also, in the case that it is the index page (home page), modified it so that the full post was displayed instead of the mobile index. I considered displaying both the link to the post along with the full details about the post because I discovered that you cannot navigate to older posts in the mobile version on the home page (you had to be viewing a post for it to detect that there is older content).
After customizing the navigation, and failing to get it to work like the desktop version, I decided to just live without it for the mobile for the time being. At least it is closer to what was requested: show only the most recent content. I will have to return to this navigation problem another day.
The following will show both the link to the most recent post along with the full content of the post:
<!-- posts -->
<div class='blog-posts hfeed'>
<b:include data='top' name='status-message'/>
<b:if cond='data:blog.pageType == "index"'>
<b:loop values='data:posts limit 1' var='post'>
<b:include data='post' name='mobile-index-post'/>
<b:include data='post' name='mobile-post'/>
</b:loop>
<b:else/>
<b:loop values='data:posts' var='post'>
<b:include data='post' name='mobile-post'/>
</b:loop>
</b:if>
</div>
But this is what I currently have so that only the full content is displayed for the most current post :
<!-- posts -->
<div class='blog-posts hfeed'>
<b:include data='top' name='status-message'/>
<b:if cond='data:blog.pageType == "index"'>
<b:loop values='data:posts limit 1' var='post'>
<b:include data='post' name='mobile-post'/>
</b:loop>
<b:else/>
<b:loop values='data:posts' var='post'>
<b:include data='post' name='mobile-post'/>
</b:loop>
</b:if>
</div>
This is a known bug in the mobile templates. If the post count is set to less than 5 posts, then the mobile homepage will always show minimum 5 posts irrespective of whether it is a custom mobile template or not. On all the further pages (accessible via Next post links), the count set via the settings will be respected
A partial solution to this problem is to switch to Custom mobile templates and then make the following changes to the template code -
<b:loop values='data:posts limit 1' var='post'>
<b:include data='post' name='mobile-index-post'/>
</b:loop>
Other than this, Lambda expressions can also be used -
<b:loop values='data:posts first(p => p)' var='post'>
<b:include data='post' name='mobile-index-post'/>
</b:loop>
This will visually resolve the issue of displaying only a single post but the next page link rather than redirecting to the 2nd post will redirect to the 6th post (the 2nd-5th post gets skipped)
What about using a responsive theme like Contempo
Showing Widget In Mobile Page In Blogger:<!-- Here Is Your Widgey-->
</b:if>
Hiding Widget In Mobile Page In Blogger:<b:if cond='data:blog.isMobileRequest == "false"'>
<!-- Here Is Your Widgey-->
</b:if>
See in Detail
How To Show / Hide Widget In Mobile Page In Blogger

Liferay: Showing Related Assets for Calendar Event in the list page

I'm working to customize liferay's Calendar portlet and have created a hook for this.
I want to show all the "Related Assets" associated with a Calendar Event directly in the list page itself where all the Events are displayed instead of the Event's detail view page.
Currently liferay shows the "Related Assets" only when we click on the Event to view the details of that Event.
Can anyone help me?
Environment: Liferay 6.1
Thanks a lot
Sabrina
I assume you already have liferay's source code and you know how to create a hook.
The JSPs you would be modifying would be in this path:
portal-web/docroot/html/portlet/calendar
So here are some steps to help you solve your query:
You need to modify the event_iterator.jspf: row.addText(event.getTitle(), rowURL);
You have to adjust the following code taken from view_event.jsp in event_iterator.jspf.
<%
AssetEntry layoutAssetEntry = AssetEntryLocalServiceUtil.getEntry(CalEvent.class.getName(), event.getEventId());
%>
<%-- <liferay-util:buffer> is a tag which stores all that is written inside
its body in a single variable string, in this case "relatedAssetsLinksBuffer"
--%>
<liferay-util:buffer var="relatedAssetsLinksBuffer">
<c:if test="<%= enableRelatedAssets %>">
<%=event.getTitle() %>
<div class="entry-links">
<liferay-ui:asset-links
assetEntryId="<%= layoutAssetEntry.getEntryId() %>"
/>
</div>
</c:if>
</liferay-util:buffer>
Now the line in step-1 becomes: row.addText(relatedAssetsLinksBuffer, rowURL);
I have not tried this but I think it would work or will atleast give you some help in solving your query.
Tip for Hooks (might be useful in future):
Liferay follows a convention in storing its JSPs, so for custom-jsps Hook (i.e. a hook created for modifying liferay's JSP) you just need to search for that particular JSP & modify it.
For Eg: You wanted to modify the first page of calendar portlet. So liferay portlet's first page is always view.jsp located in the folder with the same name as the portlet-name in this case "Calendar" and view.jsp will contain some tags like <%# include /> or <liferay-util:include /> which would include other files to show the content. So you can always start with a view.jsp and navigate ahead. By the way the names of the JSPs are also most of the time self-explanatory.
Hope this helps.

Can we have links of related lists in a VF page

I have a VF page in which i have related lists displayed using
<apex:relatedList list="NOTESANDATTACHMENTS"/>
Is there a way i can have the link of the related list on the top of the page like the ones in standard page? The reason for this is that my VF page is pretty long and the user needs to scroll to get the view the notes and attachment list.
is there any way we can achieve this?
Thanks
Not directly, but you can always use anchor links.
Go to related list
...
<a id="mylist" />
<apex:relatedList list="NOTESANDATTACHMENTS"/>
The relationship name for the Notes and Attachments related list has been changed in winter 14 release.
you can show the attachement in the relatedlist tag.
apex:relatedList list="CombinedAttachments" subject="{!$CurrentPage.parameters.id}"
in the VF page if you are using Standard controller then there is no need to add subject attribute.

How do I embed a video in a knowledge article?

I want to embed videos in my knowledge articles, and I have been trying to follow the steps from these two posts:
http://boards.developerforce.com/t5/General-Development/Embedded-Video-in-New-Knowledge-Base/td-p/19...
http://success.salesforce.com/ideaView?id=087300000006n6v
Under Setup->Customize->Knowledge->Article Types, I have an article type of "Video Tutorial" with the title test_video_tutorial. I have a custom field called "Tutorial" with an API name of "Tutorial__c".
In Article Management, I created a new article of type "Video Tutorial" and the Tutorial field I have this:
<div class="youtube">http://www.youtube.com/v/TDArzCNu178?</div>
In Setup->Develop->Pages, I created a new Visualforce Page called VideoTutorialPage like this:
<apex:page standardController="Video_Tutorials__kav" showHeader="true">
<apex:outputPanel >
<apex:outputField value="{!Video_Tutorials__kav.Title}"/>
<apex:outputText escape="false" value="{!Video_Tutorials__kav.Tutorial__c}"/>
</apex:outputPanel>
</apex:page>
However, when I click on the article "test_video_tutorial" in my Articles, the video doesn't get embedded. I just see the html code for it. Is there something I have to do to tell Salesforce that when I click on a Video Tutorial article, that it should use the Visualforce Page I created? What is it that I have to do to get the video to show up?
In the Summer 12 release this was made a lot easier by allowing <iframe> tags in knowledge articles. See the Summer 12 release notes (section "Multimedia Content in Articles") for details

Add a custom link/button to a visualforce page?

I have a custom link on the opportunity object which points to an external site. Is it possible to add this custom link to a visualforce page?
The solution I came up with was to copy the url salesforce creates for this custom link, and paste it in the page. It looks something like this:
my custom link
This works fine, however, it won't work once it's in a managed package installed on other servers because the lid param will be different (the custom link id). Is there a solution for this?
Have you thought about putting the URL of the link in a field on the opportunity object and then creating an output link on your VF page?
Paul
Look under $Action. Buttons and links are available via that global variable. For example $Action.Opportunity.CustomLink
To build off the answer from danieljimenez, the $Action global variable provides access to the button/link objects. From there you need to use the URLFOR function to get it into a usable form. Then you can either put it into the action param of a command button, or use it as you'd like anywhere else in your markup.
<apex:commandButton action="{!URLFOR($Action.My_Obj__c.My_custom_link)}" value="My custom button"/>
or
My link
create New Contact (Salesforce button target _blank)
<apex:commandLink target="_blank"
styleClass="btn"
style="text-decoration:none;padding:4px;"
action="{!URLFOR($Action.Contact.NewContact)}"
value="Create New Contact" />

Resources