About post summary and content

Permalink Browser Info Environment
When creating a new blog post there is the “Blog description” and the “Blog content” field. It looks like the description is only adding a meta description. What I would like to have is an actual summary section/field (WYSIWYG editor) that would display its contents in the blog post list on the main page, kind of like the default blog set-up the comes with C5 (with “blog post more” kind of thing).

I see that there is a “truncate” feature for the blog post list. However, this is altering the content in such a way that it removes everything that’s not text and even merges multiple paragraphs into one. I, for example, have some videos that I would like to show up in the summaries on the blog post list. How can this be achieved?

Type: Discussion
Status: New
10010110
View Replies:
RadiantWeb replied on at Permalink Reply
RadiantWeb
well, hopefully you're creating your own custom block view. follow my tutorial here to learn more: http://stratisdesign.com/stratisdesign/blog/design/custom-block-vie...

One of the views (I believe the "simple" prolog list view has what you are after regarding images and content)

The idea with the provided example views is they are not "limitations", but rather "starting points" for you to customize and create limitlessly how you want your blog content to be displayed.

all example code is fairly well commented and has appropriate variable names and functions. So, you should be able to try all the various provided example views and pick and choose what features you like about each one, and copy in certain parts for your own custom block view of the prolog list block.

Hope this helps,
ChadStrat
10010110 replied on at Permalink Reply
10010110
Hi Chad,

Thanks for your quick reply. I’m sorry, I think I have expressed myself not clearly enough. What I’m after is that I want to have a post “teaser” (if that’s the right word) in the blog post list that can also display images and videos. Like, I’d have one or two (or any amount of) paragraphs of text in that post list and upon clicking the “read more” link it takes me to the complete article (which has much more content).

I *do* have copied the simple problog list view template into my own directory and have successfully done some modifications according to my desire (like adding the author name to the list entries – although I have some unrelated problems there, too) but there is nothing that gives me the option to retreive a custom introductory kind of content per post. If I uncheck the “Truncate Summaries” checkbox in the “Edit ProBlog List” window it just shows the complete posts in the list.

So, to clarify again: I want to have a separate entry field for a post intro or summary, however you wanna call it, that would show its content in the post list (but not the entire post!) including images and videos and the like.

Or have I just missed something here?
RadiantWeb replied on at Permalink Reply
RadiantWeb
well, what I would do is do something like a "horizontal line" in your main content area to separate preview content from main blog content. Then do as I stated above to simply pull the content block instead of the page description, and then "explode" that content var by the horizontal element like so:

<?php
$block = $cobj->getBlocks('Main');
foreach($block as $b) {
   if($b->getBlockTypeHandle()=='content'){
      $content = $b->getInstance()->getContent();
   }
}
$content_array = explode('<hr/>', $content);
$preview_content = $content_array[0];
//inversely $blog_content = $content_array[1]
?>



Then just make sure you do the same in a custom blog_post content block custom block view to explode out the preview content as pointed out in the sample code above.

The reason this is the best way, is because you can't merely add another content/text attribute to the page because standard C5 content attributes do not support video. hence the custom ProBlog content editor.

Hope this helps,
ChadStrat
10010110 replied on at Permalink Reply
10010110
Hi Chad,

That exploding is working – kind of. The only problem now is that it splits the content literally, including all HTML which could leave us with opened elements that are never closed, invalidating the code in the best case, and screw up the page in the worst case. I think I’m gonna stay with the default way of truncating for now so the client has to live with it.

But thanks nevertheless, that’s some great work there.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.