ASPX templates
Version 4.x > ASPX templates > Link Blog to another page View modes: 
User avatar
Member
Member
pfrauholle - 11/7/2010 5:51:38 AM
   
Link Blog to another page
Hi,

I'm trying to link my Blogs (sitting underneath page 'blogs') to another page 'home'. I used the function 'Link an existing document'.

Page 'blogs' has listed all my blogs (categorized) and on the homepage I'm trying to achieve to list all blog entries using the blog preview transformation.

The linked blogs are showing up underneath my homepage, but no content is displaying. I'm using the exact code as for the page 'blogs'. Do I need to set a path or anything else in order to show all the blog entries on the homepage?

I'm using the ASPX template mode and the code I'm using for the homepage is following:


<uc1:repeater runat="server" ID="rptMonthPosts" ShowForDocumentTypes="cms.blogmonth"
Path="./%" ClassNames="cms.blogpost" OrderBy="BlogPostDate DESC" TransformationName="cms.blog.PostPreview"
ResultsPosition="top" EnableViewState="false" />

<uc1:repeater runat="server" ID="rptAllPosts" ShowForDocumentTypes="cms.blog;cms.blogpost;CMS.MenuItem"
ClassNames="cms.blogpost" OrderBy="BlogPostDate DESC" TransformationName="cms.blog.PostPreview"
SelectedItemTransformationName="cms.blogpost.Default" EnableViewState="false" />
<div class="comments">
<uc1:CommentView runat="server" ID="CommentView" ShowForDocumentTypes="cms.blogpost"
CheckPermissions="False" ShowDeleteButton="true" ShowEditButton="true" DisplayTrackbacks="true" EnableViewState="false" />
</div>


The name of my blogs I like to display are blogname1 and blogname2.

They showing fine on the blog page but as I said not as a linked document to the homepage.

Any help would be highly appreciated.

Thanks & Regards,
Patricia

User avatar
Member
Member
pfrauholle - 11/8/2010 8:09:54 PM
   
RE:Link Blog to another page
Hi,

would like to add a screenshot of the problem I'm trying to solve. The screenshot shows all the blogs listed under some pages. And on the homepage I have two linked blogs listed, but nothing is appearing on the homepage. I'm using the controls (code above) listed above and their transformations.

User image

I'm trying to link all my blogs to the homepage and have the preview summary of each blog post listed on the homepage.

What I do wrong and how can I fix this?

Thanks,
Patricia

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 11/9/2010 9:09:52 AM
   
RE:Link Blog to another page
Hi,

I’m not quite sure if I understand this correctly, but in my opinion, you do not need to use linked documents at all. You are using some page template on your home document and on your page template you would like to display some data (documents) from different section of your content tree. So, you just need to set Path properties of your repeater web parts to correct section of your web site in this case to /inspirationen/%.

Best regards,
Miroslav Remias.

User avatar
Member
Member
pfrauholle - 11/9/2010 11:51:20 PM
   
RE:Link Blog to another page
Hi,

thanks, that did the trick :)

Two more questions I have:
1. Can I assign more than 1 page to the Path element, for example like this:
Path="/inspirationen/%; /secondPage/% ?
2. When using several blog elements of one site, does this will affect the performance of the site? I just found it easier to create one blog for each category instead of using tags etc. Is this a right thing to do?

Thanks for your advice.

Patricia

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 11/16/2010 4:20:57 AM
   
RE:Link Blog to another page
Hi,

As per question one, you can set Path property to "/%" and specify several paths in WhereCondition.

Example:

WhereCondition = "NodeAliasPath LIKE '/firstpage%' OR NodeAliasPath LIKE '/secondpage%'"


In other words, you cannot set two paths in Path property.

As per your second question, could you please try to be more specific since there are following document types in Kentio CMS:

CMS.Blog
CMS.BlogMonth
CMS.BlogPost

So, I’m not quite sure what do you mean by "blog elements". Well, it is completely up to you which approach you will choose.

Best regards,
Miroslav Remias.

User avatar
Member
Member
yuvi.arinalinfosystems-gmail - 1/19/2011 1:02:13 AM
   
RE:Link Blog to another page
For your problem you may give your blog url in the URL tab it will open for working.

.Net framework development | ASP.NET Development