Blog Description Not Pulling Through In Custom Block?


I'm trying to pull through blog descriptions on a block containing a list of blog posts.

I've created a new block `.tpl` file and assigned it in the backend, though `$page.spoiler` doesn't seem to pull anything back and neither does `$page.description`.

Can anyone point out what I'm doing wrong? Or provide a link to a list of template variables? I'm struggling to find one.



Here is my loop:

{foreach from=$items item="page" name=blogEntry}
                {if $smarty.foreach.blogEntry.index == 2}

                {include file="common/image.tpl" assign="object_img" images=$page.main_pair}

                <section class="news_entry">
    				<a href="{"pages.view?page_id=`$page.page_id`"|fn_url}" class="image">
    					{$object_img nofilter}
    				<div class="text">
    					<h2><a href="{"pages.view?page_id=`$page.page_id`"|fn_url}">{$}</a></h2>
    				<a href="{"pages.view?page_id=`$page.page_id`"|fn_url}" class="bottom">Find out How We Can Help You</a>


Please add the following code to see the whole content if the $items array:


If it does not contain required information, most possibly additional php changes are required

Already dumped that earlier, though tried again, nothing available unfortunately, but thought that dump might not contain everything that I could use...

It looks like the existing blog listing on "/blog" use "$page.spoiler", but that doesn't seem to be available in the dump :(

Could you suggest what php changes I would need to do?

Edit*: Example dump -

[43] => Array
            [page_id] => 43
            [company_id] => 1
            [parent_id] => 7
            [id_path] => 7/43
            [status] => A
            [page_type] => B
            [position] => 0
            [timestamp] => 1451952000
            [usergroup_ids] => 0
            [localization] => 
            [new_window] => 0
            [related_ids] => 
            [use_avail_period] => N
            [avail_from_timestamp] => 0
            [avail_till_timestamp] => 0
            [facebook_obj_type] => activity
            [page] => Our New E-Commerce Website
            [seo_name] => our-new-e-commerce-website
            [seo_path] => 7
            [level] => 1
            [main_pair] => Array
                    [pair_id] => 1156
                    [image_id] => 1369
                    [detailed_id] => 0
                    [position] => 0
                    [icon] => Array
                            [image_path] =>
                            [alt] => 
                            [image_x] => 350
                            [image_y] => 187
                            [http_image_path] =>
                            [https_image_path] =>
                            [absolute_path] => /Users/username/sites/site/public/images/blog/1/news2.jpg
                            [relative_path] => blog/1/news2.jpg

        [author] => Admin Admin

Could you please clarify how did you add new block with blog posts to the blog manager?

Did you just add new file to the addons/blog/blocks directory?

What filling type do you use?

Yes sure. I suspect that could be the problem as recently discovered that I should be using hooks rather than creating my own templates I think. Though I just tried a dump in the default blog block templates and I don't seem to be able to get the descriptions there either.

I created a new file at "public/design/themes/responsive/templates/addons/blog/blocks/custom_recent_posts.tpl"

I then assigned my new template (which appears in the dropdown list) to the "blog" block in the block manager when editing the blocks for the home page.

Ok so it looks like I was on the right track with creating a completely independent template file, rather than somehow creating a hook for that.

If getting a blog post's description is not possible using the $page variable within the loop, is there another way to get a blog posts description? I've tried looking at other block types, though the ones that seem suitable don't list the blog page (or it's children) as an actual page within the navigation anyway.

Blocks I've tried: RSS feed, Main Menu, Pages, Latest Blog.

Is there a hidden page where the RSS would live? I could at least then get the description with ajax without having to parse the data...

Could I do a custom query somehow within a template instead?

Not good solution from my point of view, but the following code can be used:

{foreach from=$items item="page" name=blogEntry}
    {$_page_data = $page.page_id|fn_get_page_data}
    {$_page_data.description nofilter}

If it does not suit you, additional examination is required

Ah fantastic so fn_get_page_data gets the page object I guess?

Thank you!

Ah fantastic so fn_get_page_data gets the page object I guess?

Thank you!

Right, it will take all details of this CMS page from the database

Wow can't believe there are literally no docs for this.

Just found you can use "fn_get_category_data" & "fn_get_product_data" too.

Wow can't believe there are literally no docs for this.

Just found you can use "fn_get_category_data" & "fn_get_product_data" too.

Actually you can use any PHP function in this way.